gst-kitchen 0.4.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/gst-kitchen.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require "erb"
2
2
  require "time"
3
3
  require "uri"
4
+ require "cgi"
4
5
 
5
6
  require "yajl"
6
7
  require "yaml"
@@ -8,6 +9,7 @@ require "yaml"
8
9
  require "gst-kitchen/version"
9
10
  require "gst-kitchen/podcast"
10
11
  require "gst-kitchen/feed"
12
+ require "gst-kitchen/chapter"
11
13
  require "gst-kitchen/episode"
12
14
  require "gst-kitchen/media"
13
15
 
@@ -0,0 +1,15 @@
1
+ class Chapter < Struct.new(:start, :title)
2
+ include Comparable
3
+
4
+ def initialize(*args)
5
+ super
6
+ end
7
+
8
+ def self.from_auphonic(production)
9
+ chapters = production.meta
10
+ end
11
+
12
+ def <=>(other)
13
+ self.start <=> other.start
14
+ end
15
+ end
@@ -1,4 +1,4 @@
1
- class Episode < Struct.new(:number, :name, :length, :media, :auphonic_uuid, :published_at, :summary)
1
+ class Episode < Struct.new(:number, :name, :length, :media, :auphonic_uuid, :published_at, :summary, :chapters)
2
2
  include Comparable
3
3
 
4
4
  def self.from_auphonic(production)
@@ -30,6 +30,12 @@ class Episode < Struct.new(:number, :name, :length, :media, :auphonic_uuid, :pub
30
30
  episode.summary = metadata[:summary]
31
31
  episode.media = media
32
32
 
33
+ episode.chapters = data["data"]["chapters"].map do |chapter|
34
+ Chapter.new(chapter["start"], chapter["title"])
35
+ end
36
+
37
+ episode.chapters.sort!
38
+
33
39
  episode
34
40
  end
35
41
 
@@ -4,12 +4,14 @@ class Media
4
4
  class Format < Struct.new(:format, :file_ext, :mime_type)
5
5
  Mp3 = self.new("mp3", "mp3", "audio/mpeg")
6
6
  M4a = self.new("aac", "m4a", "audio/x-m4a")
7
+ Opus = self.new("opus", "opus", "audio/opus")
7
8
  end
8
9
 
9
10
  def self.format(format)
10
11
  case format
11
12
  when :m4a_aac then Media::Format::M4a
12
13
  when :mp3_mp3 then Media::Format::Mp3
14
+ when :opus_opus then Media::Format::Opus
13
15
  end
14
16
  end
15
17
 
@@ -1,3 +1,3 @@
1
1
  module GstKitchen
2
- VERSION = "0.4.1"
2
+ VERSION = "0.5.0"
3
3
  end
@@ -1,5 +1,5 @@
1
1
  <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2
- <rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
2
+ <rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:psc="http://podlove.org/simple-chapters" version="2.0">
3
3
  <channel>
4
4
  <title><%= @podcast.title %></title>
5
5
  <link><%= @podcast.website %></link>
@@ -44,6 +44,14 @@
44
44
  <itunes:summary><![CDATA[<%= episode.summary %>]]></itunes:summary>
45
45
  <description><![CDATA[<%= render_as_markdown episode.summary %>]]></description>
46
46
  <atom:link rel="http://podlove.org/deep-link" href="<%= @podcast.deep_link_url(episode) %>" />
47
+
48
+ <% unless episode.chapters.nil? %>
49
+ <psc:chapters>
50
+ <% episode.chapters.each do |chapter| %>
51
+ <psc:chapter start="<%= chapter.start %>" title="<%= CGI.escape_html chapter.title %>" />
52
+ <% end %>
53
+ </psc:chapters>
54
+ <% end %>
47
55
  </item>
48
56
  <% end %>
49
57
  </channel>
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.4.1
4
+ version: 0.5.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-28 00:00:00.000000000 Z
12
+ date: 2013-02-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: yajl-ruby
@@ -110,6 +110,7 @@ files:
110
110
  - lib/gst-kitchen/auphonic.rb
111
111
  - lib/gst-kitchen/auphonic/account.rb
112
112
  - lib/gst-kitchen/auphonic/production.rb
113
+ - lib/gst-kitchen/chapter.rb
113
114
  - lib/gst-kitchen/episode.rb
114
115
  - lib/gst-kitchen/feed.rb
115
116
  - lib/gst-kitchen/media.rb
@@ -130,7 +131,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
130
131
  version: '0'
131
132
  segments:
132
133
  - 0
133
- hash: 2606944535650816007
134
+ hash: 1152790057894084617
134
135
  required_rubygems_version: !ruby/object:Gem::Requirement
135
136
  none: false
136
137
  requirements:
@@ -139,10 +140,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
140
  version: '0'
140
141
  segments:
141
142
  - 0
142
- hash: 2606944535650816007
143
+ hash: 1152790057894084617
143
144
  requirements: []
144
145
  rubyforge_project:
145
- rubygems_version: 1.8.24
146
+ rubygems_version: 1.8.25
146
147
  signing_key:
147
148
  specification_version: 3
148
149
  summary: gst-kitchen is a gem to publish podcasts like a nerd with auphonic!