gst-kitchen 0.6.4 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/README.md +2 -2
- data/lib/gst-kitchen/episode.rb +8 -2
- data/lib/gst-kitchen/version.rb +1 -1
- data/spec/episode_spec.rb +2 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd22ef2f66a262d106e720540f4a3f2bc04d0dd6
|
4
|
+
data.tar.gz: 5b9df755f3a5fbcc00997dc9cc079390f6aa3cb6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7917a44bc439d567d472020016aab954cd5a14001c36f144c18e67f397cd8e9c94c7e366e3fac15b037e139e3da5b5ebe0aae36b643c6e6d68abacb579927a7
|
7
|
+
data.tar.gz: 07c7628bf4a0d3d9949f5f642ae55a5e4b0adbe18e384e179237528cdc5e83fdd9be6084925b4c479560a893e047ee9bae7d0ef43c2f766bdf721729403afa33
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -36,8 +36,8 @@ gst-kitchen assumes various conventions about (file) naming and URLs.
|
|
36
36
|
* feeds: feeds must be located at: `<website_url>/episodes.<format_file_ext>.rss`, e.g. `http://geekstammtisch.de/episodes.m4a.rss`
|
37
37
|
* episode media files must be located at: `<media_url>/<downcased handle><padded episode_nr>.<format_file_ext>`, e.g. `http://media.geekstammtisch.de/episodes/gst000.m4a`
|
38
38
|
|
39
|
-
Meta data from each episodes is read from your Auphonic production. The episode number is read from the `title`,
|
40
|
-
which must start with `<handle><number>`. The
|
39
|
+
Meta data from each episodes is read from your Auphonic production. The episode number and name is read from the `title`,
|
40
|
+
which must start with `<handle><number>`. The summary and description is
|
41
41
|
set to Auphonic's `summary` field. File sizes, playtime etc. are also read from the production.
|
42
42
|
|
43
43
|
|
data/lib/gst-kitchen/episode.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
class Episode < Struct.new(:number, :name, :length, :media, :auphonic_uuid, :published_at, :summary, :chapters)
|
1
|
+
class Episode < Struct.new(:number, :name, :subtitle, :length, :media, :auphonic_uuid, :published_at, :summary, :chapters)
|
2
2
|
include Comparable
|
3
3
|
|
4
4
|
attr_accessor :podcast
|
@@ -10,6 +10,7 @@ class Episode < Struct.new(:number, :name, :length, :media, :auphonic_uuid, :pub
|
|
10
10
|
episode = self.new podcast
|
11
11
|
episode.number = metadata[:number]
|
12
12
|
episode.name = metadata[:name]
|
13
|
+
episode.subtitle = metadata[:subtitle]
|
13
14
|
episode.length = metadata[:length].round
|
14
15
|
episode.auphonic_uuid = metadata[:auphonic_uuid]
|
15
16
|
episode.published_at = Time.now
|
@@ -30,6 +31,10 @@ class Episode < Struct.new(:number, :name, :length, :media, :auphonic_uuid, :pub
|
|
30
31
|
title.match(/#{handle}(\d{3})/) { |match| match[1].to_i }
|
31
32
|
end
|
32
33
|
|
34
|
+
def extract_name(handle, title)
|
35
|
+
title.match(/#{handle}\d{3} ?- ?(.*)$/) { |match| match[1] }
|
36
|
+
end
|
37
|
+
|
33
38
|
def extract_episode_data_from_auphonic(podcast, production)
|
34
39
|
data = production.meta
|
35
40
|
|
@@ -37,7 +42,8 @@ class Episode < Struct.new(:number, :name, :length, :media, :auphonic_uuid, :pub
|
|
37
42
|
auphonic_uuid: data["data"]["uuid"],
|
38
43
|
number: extract_episode_number(podcast.handle, data["data"]["metadata"]["title"]),
|
39
44
|
length: data["data"]["length"],
|
40
|
-
name: data["data"]["metadata"]["
|
45
|
+
name: extract_name(podcast.handle, data["data"]["metadata"]["title"]),
|
46
|
+
subtitle: data["data"]["metadata"]["subtitle"].strip,
|
41
47
|
summary: data["data"]["metadata"]["summary"].strip,
|
42
48
|
}
|
43
49
|
|
data/lib/gst-kitchen/version.rb
CHANGED
data/spec/episode_spec.rb
CHANGED
@@ -23,7 +23,7 @@ describe Episode do
|
|
23
23
|
"length" => 1234,
|
24
24
|
"metadata" => {
|
25
25
|
"title" => "GST023 - Rikeripsum",
|
26
|
-
"subtitle" => "
|
26
|
+
"subtitle" => "Talk about going nowhere fast. Mr. Worf, you sound like a man who's asking his friend if he can start dating his sister.",
|
27
27
|
"summary" => "summary"
|
28
28
|
},
|
29
29
|
"output_files" => [
|
@@ -39,6 +39,7 @@ describe Episode do
|
|
39
39
|
episode = Episode.from_auphonic podcast, production
|
40
40
|
episode.number.should == 23
|
41
41
|
episode.name.should == "Rikeripsum"
|
42
|
+
episode.subtitle.should == "Talk about going nowhere fast. Mr. Worf, you sound like a man who's asking his friend if he can start dating his sister."
|
42
43
|
episode.length.should == 1234
|
43
44
|
episode.auphonic_uuid.should == "id"
|
44
45
|
episode.published_at.should == now
|