kagu 0.4.5 → 0.4.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/lib/kagu/playlist.rb +11 -10
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d4b993fe54c9f0a4e84e09bb7cdb9fc5e9b9e971
4
- data.tar.gz: 9aeff1f243ef81c1e15b439c4b086279b96a9b17
3
+ metadata.gz: e72459fb8b2155a8648292713869ec81035bbae3
4
+ data.tar.gz: 535005114a5406af37e19bb0cd57965934148b33
5
5
  SHA512:
6
- metadata.gz: 3f9fbe51d2f9fe6f1c8af9afee40f48f3a79e61d4b0b8e59db10b359c32dc1c31964449ba24246115ff723c55f6db6850fe51b72cbe7b0a25c91bd566bf361b2
7
- data.tar.gz: d98d4576bdada6675ec6daecaf7268d94778569fdedeb8d35b0718cb530051caa6254ece2566e34ff235058d78ea257acac3b722d3f69cd3880f1b99553fea04
6
+ metadata.gz: 92d42997513966eb67d979f4b005406f0dd48ecb3933ead9ee0f55e3a933eec1a40e9b46b8051ab846669db12cc7ae43c00baeb8a592f497420d92e29e6acfc6
7
+ data.tar.gz: 5ae20b503952c9ff4ce2924c2c0172584efacd416a584059380ad77d84089b690b8c45f16db80afb3adce98dd0d690230c3146243eed59b32eeda886ec2edb9b
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.5
1
+ 0.4.6
data/lib/kagu/playlist.rb CHANGED
@@ -28,16 +28,17 @@ module Kagu
28
28
  private
29
29
 
30
30
  def add_tracks
31
- ids = tracks.map(&:id)
32
- AppleScript.execute(%Q{
33
- tell application "iTunes"
34
- set playlistToPush to user playlist #{name.inspect}
35
- set idsToAdd to {#{ids.join(',')}}
36
- repeat with idToAdd in idsToAdd
37
- duplicate (tracks of library playlist 1 whose database ID is idToAdd) to playlistToPush
38
- end repeat
39
- end tell
40
- })
31
+ tracks.map(&:id).each_slice(500) do |ids|
32
+ AppleScript.execute(%Q{
33
+ tell application "iTunes"
34
+ set playlistToPush to user playlist #{name.inspect}
35
+ set idsToAdd to {#{ids.join(',')}}
36
+ repeat with idToAdd in idsToAdd
37
+ duplicate (tracks of library playlist 1 whose database ID is idToAdd) to playlistToPush
38
+ end repeat
39
+ end tell
40
+ })
41
+ end
41
42
  true
42
43
  rescue => e
43
44
  raise Error.new(e)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kagu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.5
4
+ version: 0.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexis Toulotte
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-02 00:00:00.000000000 Z
11
+ date: 2016-01-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport