dubbletrack_remote 0.7.6 → 0.8.0

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: fbd23b3429fcbcfddcd0f46d491d01e060ff2a269ae2f0b2f3d0baa37c3d1def
4
+ data.tar.gz: 9848afcc5a09b4dd37bf5ccd48eb93064d0fe15a67a606a6a92ec6ca820d04b9
5
5
  SHA512:
6
- metadata.gz: 9588dd28c7cc4fa3a777b6661890c406880262f4178d7b7e7492c36f7644b9f182631494661bf871010f6f7506fffddf37e29a6da4abcbcc493076356d1d0c4b
7
- data.tar.gz: 233b9b24c04cb436c9ca9716e0f0ab2350fcabd4a9257b1dfd9350a0b88e2a0ad48a6d840416dc5d4569b31beffde3d89e2faf6e416cbb629110bebe34e681f6
6
+ metadata.gz: 4071400ce0276d7767760886ff4f0aab2b6e9f6a7846493ea0d0f5884881dadcb9495021fea40da1b7f44069f980ca985ad166fa7718d7d3ee5d159380052a71
7
+ data.tar.gz: 90c035c0f5be2d929e06535ab587fa02b24471fb5ac4b4385bfad413484b850d9386d29aa65257ffcb5b93248d60d965dde01f949f0c6e4fcf44ee49907b55c8
@@ -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,18 @@
1
1
  dubbletrack remote changelog
2
2
 
3
+ # [0.8.0](https://github.com/dubbletrack/remote/compare/v0.7.6...v0.8.0) (2024-07-10)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * use delay time for test ([37d3fb6](https://github.com/dubbletrack/remote/commit/37d3fb669929800277e39942f565cf1f14075854))
9
+
10
+
11
+ ### Features
12
+
13
+ * send in batches ([be99f11](https://github.com/dubbletrack/remote/commit/be99f11d13b377b1e4f751b65c9fd42c766b3217))
14
+ * update to use v2 endpoint and save uuids ([51e0e6f](https://github.com/dubbletrack/remote/commit/51e0e6f4c2208d5281feb0b8f5281924bac78e39))
15
+
3
16
  ## [0.7.6](https://github.com/dubbletrack/remote/compare/v0.7.5...v0.7.6) (2023-06-15)
4
17
 
5
18
 
@@ -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))
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
+ Item.where(id: remaining.pluck(:id)).remaining.find_in_batches(batch_size: 25) do |items|
88
+ client.send(items)
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.0"
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.0
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