dubbletrack_remote 0.7.6 → 0.8.1

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
  SHA256:
3
- metadata.gz: b3f19a602957d1a970cd29d9c323c5ac127133b938eddd9f988c5d6b8ba9650a
4
- data.tar.gz: d5d9af295c1882331ca6db41d92afac42661dacc02b7be8581a430f9b729a19d
3
+ metadata.gz: 6bab3eb59f38391bededa96b0a8fcec79ed55ef13ce2b4b86d73d1e95f4a9b48
4
+ data.tar.gz: 335bfcb6b730533b350c1d9abcc16765989bd94bb6a7f3846acc8035b247517d
5
5
  SHA512:
6
- metadata.gz: 9588dd28c7cc4fa3a777b6661890c406880262f4178d7b7e7492c36f7644b9f182631494661bf871010f6f7506fffddf37e29a6da4abcbcc493076356d1d0c4b
7
- data.tar.gz: 233b9b24c04cb436c9ca9716e0f0ab2350fcabd4a9257b1dfd9350a0b88e2a0ad48a6d840416dc5d4569b31beffde3d89e2faf6e416cbb629110bebe34e681f6
6
+ metadata.gz: b58c6025392b9441dc15dcd4e1b5067ec91e0d02217beef87a0490556e782dd9bfd28975443391541914aaa2ec9286532333ffaed939428460d32b800181776e
7
+ data.tar.gz: 3457d8f677d12b05a643886c3ad7a0f87de1da6560077004c33fa850be1bc9dd80c8ed426d95181287bf6f40bb57ff0bee09429c7764b87b4e89d92a43419ec8
@@ -18,7 +18,7 @@ jobs:
18
18
  runs-on: ubuntu-latest
19
19
  strategy:
20
20
  matrix:
21
- ruby-version: ['2.6', '2.7', '3.0']
21
+ ruby-version: ['3.1']
22
22
  steps:
23
23
  - uses: actions/checkout@v3
24
24
  - name: Set up Ruby
data/.tool-versions CHANGED
@@ -1 +1 @@
1
- ruby 2.7.2
1
+ ruby 3.1.2
data/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  dubbletrack remote changelog
2
2
 
3
+ ## [0.8.1](https://github.com/dubbletrack/remote/compare/v0.8.0...v0.8.1) (2024-07-10)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * fix to_a bug ([322df50](https://github.com/dubbletrack/remote/commit/322df50c3c197087425aad60cd886cdd162f458a))
9
+
10
+ # [0.8.0](https://github.com/dubbletrack/remote/compare/v0.7.6...v0.8.0) (2024-07-10)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * use delay time for test ([37d3fb6](https://github.com/dubbletrack/remote/commit/37d3fb669929800277e39942f565cf1f14075854))
16
+
17
+
18
+ ### Features
19
+
20
+ * send in batches ([be99f11](https://github.com/dubbletrack/remote/commit/be99f11d13b377b1e4f751b65c9fd42c766b3217))
21
+ * update to use v2 endpoint and save uuids ([51e0e6f](https://github.com/dubbletrack/remote/commit/51e0e6f4c2208d5281feb0b8f5281924bac78e39))
22
+
3
23
  ## [0.7.6](https://github.com/dubbletrack/remote/compare/v0.7.5...v0.7.6) (2023-06-15)
4
24
 
5
25
 
@@ -1,4 +1,4 @@
1
- api_url: https://data.dubbletrack.com/api/v1/stations/[station_id]/automation
1
+ api_url: https://data.dubbletrack.com/api/v2/automation
2
2
  api_key:
3
3
  api_secret:
4
4
  automation:
@@ -55,7 +55,7 @@ Gem::Specification.new do |spec|
55
55
  spec.add_dependency "require_all", "~> 3.0"
56
56
  spec.add_dependency "rspec", "~> 3.9.0"
57
57
  spec.add_dependency "sinatra-activerecord", "~> 2.0.18"
58
- spec.add_dependency "sqlite3", "~> 1.4.2"
58
+ spec.add_dependency "sqlite3", "~> 1.5.1"
59
59
  spec.add_dependency "thor", "~> 1.0.1"
60
60
  spec.add_dependency "timecop", "~> 0.9.1"
61
61
  spec.add_dependency "tzinfo", "~> 1.2.9"
@@ -23,9 +23,7 @@ module DubbletrackRemote
23
23
 
24
24
  Thread.new do
25
25
  loop do
26
- Item.next(20).each do |item|
27
- client.send([item])
28
- end
26
+ client.send(Item.next(25).to_a)
29
27
  update # this feels redundant with the watch above
30
28
  status
31
29
  rescue => e
@@ -86,8 +84,8 @@ module DubbletrackRemote
86
84
 
87
85
  if remaining.count > 0
88
86
  puts "sending #{remaining.size} from playlist #{file_path}"
89
- Item.where(id: remaining.pluck(:id)).remaining.find_each do |item|
90
- client.send(item)
87
+ items = Item.where(id: remaining.pluck(:id)).remaining.find_in_batches(batch_size: 25) do |items|
88
+ client.send(items.to_a)
91
89
  end
92
90
  end
93
91
  else
@@ -328,7 +326,7 @@ module DubbletrackRemote
328
326
  playlists_path = ask "Where should I look for playlists? (This can include regex and strftime components, i.e. /Enco/Dad/STUDIO[1-2]%m%d%y.DBF)", path: true
329
327
  end
330
328
  <<~YAMS.strip
331
- api_url: https://api.dubbletrack.com/api/v1/stations/#{station_id}/automation
329
+ api_url: https://api.dubbletrack.com/api/v2/automation
332
330
  api_key: #{api_key}
333
331
  api_secret: #{api_secret}
334
332
  automation:
@@ -13,7 +13,7 @@ module DubbletrackRemote
13
13
  faraday.adapter Faraday.default_adapter # make requests with Net::HTTP
14
14
  end
15
15
 
16
- @url = url # || 'https://dubbletrack.com/api/v1/stations/koop/shows/koop-automation/tracks'
16
+ @url = url # || 'https://api.dubbletrack.com/api/v2/automation'
17
17
  @key = key # || 'dt_xxxxxxxx'
18
18
  @secret = secret # || 'dts_xxxxxxxxxxxx'
19
19
  end
@@ -49,13 +49,12 @@ module DubbletrackRemote
49
49
 
50
50
  found_response = if data.size > 1
51
51
  data.find do |d|
52
- d["attributes"]["title"] == item.title &&
53
- d["attributes"]["artist_name"] == item.artist_name
52
+ d["remote_automation_id"] == item.automation_id
54
53
  end
55
54
  else
56
55
  data.first
57
56
  end
58
- item.remote_id = found_response["id"] if found_response
57
+ item.remote_id = found_response["uuid"] if found_response
59
58
  item.save
60
59
  puts item.pretty_print
61
60
  end
@@ -1,3 +1,3 @@
1
1
  module DubbletrackRemote
2
- VERSION = "0.7.6"
2
+ VERSION = "0.8.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dubbletrack_remote
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.6
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Keen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-15 00:00:00.000000000 Z
11
+ date: 2024-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -282,14 +282,14 @@ dependencies:
282
282
  requirements:
283
283
  - - "~>"
284
284
  - !ruby/object:Gem::Version
285
- version: 1.4.2
285
+ version: 1.5.1
286
286
  type: :runtime
287
287
  prerelease: false
288
288
  version_requirements: !ruby/object:Gem::Requirement
289
289
  requirements:
290
290
  - - "~>"
291
291
  - !ruby/object:Gem::Version
292
- version: 1.4.2
292
+ version: 1.5.1
293
293
  - !ruby/object:Gem::Dependency
294
294
  name: thor
295
295
  requirement: !ruby/object:Gem::Requirement