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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6112c6627198735b306119ed6065ce019418190f
4
- data.tar.gz: ca3476ec974aa4206a9df77c33fa5b6354f0f01f
3
+ metadata.gz: bd22ef2f66a262d106e720540f4a3f2bc04d0dd6
4
+ data.tar.gz: 5b9df755f3a5fbcc00997dc9cc079390f6aa3cb6
5
5
  SHA512:
6
- metadata.gz: 14422c735be2ed979165fb7a452e36e8e81ddb5192d6754c954fbb31190185df737f6bcf893a27cce21f3ded571588d5bb9920617b0de2246b45029bb6f0a541
7
- data.tar.gz: d5dcc2cd3e7467971bc82a0465a86d76a8fd36272007236ca8a0b5454ad94f6062ab84b672c9d49fa5c812dd76383da7cf5a3266e56a8023389ae1c7510cd42a
6
+ metadata.gz: c7917a44bc439d567d472020016aab954cd5a14001c36f144c18e67f397cd8e9c94c7e366e3fac15b037e139e3da5b5ebe0aae36b643c6e6d68abacb579927a7
7
+ data.tar.gz: 07c7628bf4a0d3d9949f5f642ae55a5e4b0adbe18e384e179237528cdc5e83fdd9be6084925b4c479560a893e047ee9bae7d0ef43c2f766bdf721729403afa33
data/.travis.yml CHANGED
@@ -1,6 +1,7 @@
1
1
  language: ruby
2
2
  rvm:
3
3
  - 1.9.3
4
+ - 2.0.0
4
5
  notifications:
5
6
  email:
6
7
  - alle@geekstammtisch.de
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 episode name is read from `subtitle`, summary and description is
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
 
@@ -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"]["subtitle"].strip,
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
 
@@ -1,3 +1,3 @@
1
1
  module GstKitchen
2
- VERSION = "0.6.4"
2
+ VERSION = "0.7.0"
3
3
  end
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" => "Rikeripsum",
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gst-kitchen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.4
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian Cohnen