kagu 3.0.3 → 3.0.4

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 +4 -6
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6c4332b49bc33b4106c01dec55d6d54d5cc2766019ca41942c85b7b6a5ded003
4
- data.tar.gz: 70d7edc16a587e28d127a3dc6b3405f4484e08d48bc608e20cdba8cac444247f
3
+ metadata.gz: c72ac237dffdb85e14dd0bb2264b10f2e34bff3c709576f8341e340641030655
4
+ data.tar.gz: d198038482460222f3cc92e5996a47748d94c3f97aba6d4465aaf7bad20f4556
5
5
  SHA512:
6
- metadata.gz: f4dce3011205d91bfd0d8e6379eb1d26f66d9c2c855e248be56944bb72e91e515d1e94ed51b857703b74e8473d15b5de10b334921e1aef848227e9a3ee80db8e
7
- data.tar.gz: db3c0140efa7b9a4ed937f4e9b7ced10b621f0d2d26327788a0c24c1fe5d615414536f1f04af29d6a7419efa6194f9c649209820bbe191867b6ba331f2552a3b
6
+ metadata.gz: 02f2ae6d970dcdb39b3302f8feef95f534b45164edea028fbde2d3086acf936cc0598b72addbd58d9b9e62485433588d9051af03b24caeecd2b0ec49cf8571ad
7
+ data.tar.gz: '099947a2d0c575e5afa0aa0ced54a4dfaa874f73f19b77b1e927527ee9a4fb43eadd8c0e45fed3d34d45fb4da10c7e029e3d12f99f1e6b26b83b6c185fb91fee'
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.0.3
1
+ 3.0.4
data/lib/kagu/playlist.rb CHANGED
@@ -30,14 +30,12 @@ module Kagu
30
30
  def add_tracks
31
31
  return if tracks.empty?
32
32
  Kagu.logger.info('Kagu') { "Adding #{tracks.size} track(s) to playlist #{name.inspect}" }
33
- Dir.mktmpdir do |directory|
34
- path = "#{directory}/#{name}.m3u"
35
- File.open(path, 'w') do |io|
36
- tracks.each { |track| io << "file://#{URI.escape(track.path.to_s)}\n" }
37
- end
33
+ tracks.map(&:id).each_slice(100) do |ids|
34
+ conditions = ids.map { |id| "persistent ID is #{id.inspect}" }
38
35
  AppleScript.execute(%Q{
39
36
  tell application #{Kagu::OSX_APP_NAME.inspect}
40
- open #{path.inspect}
37
+ set playlistToPush to user playlist #{name.inspect}
38
+ duplicate (tracks of library playlist 1 whose #{conditions.join(' or ')}) to playlistToPush
41
39
  end tell
42
40
  })
43
41
  end
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: 3.0.3
4
+ version: 3.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexis Toulotte
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-03 00:00:00.000000000 Z
11
+ date: 2019-12-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport