stratify-itunes 0.1.4.1 → 0.1.4.2

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/.rvmrc CHANGED
@@ -1 +1 @@
1
- rvm use ruby-1.9.2-p290@stratify
1
+ rvm use ruby-1.9.3-p125@stratify
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- stratify-itunes (0.1.4)
4
+ stratify-itunes (0.1.4.2)
5
5
  itunes-library (~> 0.1.1)
6
6
  railties (~> 3.2.0)
7
7
  stratify-base (~> 0.1.4)
@@ -45,7 +45,7 @@ GEM
45
45
  activemodel (~> 3.1)
46
46
  mongo (~> 1.3)
47
47
  tzinfo (~> 0.3.22)
48
- multi_json (1.3.2)
48
+ multi_json (1.3.4)
49
49
  plist (3.1.0)
50
50
  rack (1.4.1)
51
51
  rack-cache (1.2)
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  Stratify is developed and tested with the following dependencies.
6
6
 
7
- * Ruby 1.9.2 (See `.rvmrc` for the specific version.)
7
+ * Ruby 1.9.3 (See `.rvmrc` for the specific version.)
8
8
  * MongoDB 2.0
9
9
 
10
10
  ## Development
@@ -44,13 +44,12 @@ module Stratify
44
44
  ::ITunes::Library.load(library_xml).tracks
45
45
  end
46
46
 
47
- def played_tracks
48
- tracks.select { |t| t.played? }
47
+ def tracks_sorted_by_last_played_at
48
+ tracks.reject { |t| t.last_played_at.nil? }.sort_by(&:last_played_at)
49
49
  end
50
50
 
51
51
  def recently_played_tracks
52
- sorted_tracks = played_tracks.sort_by(&:last_played_at)
53
- sorted_tracks.last(limit)
52
+ tracks_sorted_by_last_played_at.last(limit)
54
53
  end
55
54
  end
56
55
  end
@@ -1,5 +1,5 @@
1
1
  module Stratify
2
2
  module ITunes
3
- VERSION = "0.1.4.1"
3
+ VERSION = "0.1.4.2"
4
4
  end
5
5
  end
@@ -653,6 +653,7 @@
653
653
  <key>Date Added</key><date>2011-02-27T21:45:46Z</date>
654
654
  <key>Bit Rate</key><integer>192</integer>
655
655
  <key>Sample Rate</key><integer>44100</integer>
656
+ <key>Play Count</key><integer>6</integer>
656
657
  <key>Persistent ID</key><string>87AD381B6216E628</string>
657
658
  <key>Track Type</key><string>File</string>
658
659
  <key>Location</key><string>file://localhost/Users/z/Music/iTunes/iTunes%20Media/Music/Nirvana/Nevermind/11%20On%20A%20Plain.mp3</string>
@@ -73,6 +73,10 @@ describe "collecting and storing iTunes data", :database => true do
73
73
  it "does not collect unplayed items from iTunes" do
74
74
  Stratify::ITunes::Activity.where(:persistent_id => "8780A3C7A0117B2B").should_not exist
75
75
  end
76
+
77
+ it "gracefully ignores 'played' items that have no 'last played at' timestamp" do
78
+ Stratify::ITunes::Activity.where(:persistent_id => "87AD381B6216E628").should_not exist
79
+ end
76
80
  end
77
81
 
78
82
  describe "reading a remote iTunes library file", :database => true do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stratify-itunes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4.1
4
+ version: 0.1.4.2
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: 2012-04-29 00:00:00.000000000 Z
12
+ date: 2012-11-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties