plex_ruby_sdk 0.5.1 → 0.7.1

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.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/lib/plex_ruby_sdk/activities.rb +3 -2
  3. data/lib/plex_ruby_sdk/authentication.rb +7 -3
  4. data/lib/plex_ruby_sdk/butler.rb +9 -5
  5. data/lib/plex_ruby_sdk/hubs.rb +7 -5
  6. data/lib/plex_ruby_sdk/library.rb +31 -24
  7. data/lib/plex_ruby_sdk/log.rb +6 -2
  8. data/lib/plex_ruby_sdk/media.rb +14 -13
  9. data/lib/plex_ruby_sdk/models/operations/enablecreditsmarkergeneration.rb +18 -0
  10. data/lib/plex_ruby_sdk/models/operations/episodesort.rb +19 -0
  11. data/lib/plex_ruby_sdk/models/operations/flattenseasons.rb +4 -3
  12. data/lib/plex_ruby_sdk/models/operations/get_library_items_enablecreditsmarkergeneration.rb +18 -0
  13. data/lib/plex_ruby_sdk/models/operations/get_library_items_episodesort.rb +19 -0
  14. data/lib/plex_ruby_sdk/models/operations/get_library_items_flattenseasons.rb +4 -3
  15. data/lib/plex_ruby_sdk/models/operations/get_library_items_metadata.rb +14 -8
  16. data/lib/plex_ruby_sdk/models/operations/get_library_items_queryparam_type.rb +2 -0
  17. data/lib/plex_ruby_sdk/models/operations/get_library_items_showordering.rb +8 -8
  18. data/lib/plex_ruby_sdk/models/operations/get_meta_data_by_rating_key_metadata.rb +17 -2
  19. data/lib/plex_ruby_sdk/models/operations/get_recently_added_metadata.rb +14 -8
  20. data/lib/plex_ruby_sdk/models/operations/get_search_all_libraries_enablecreditsmarkergeneration.rb +18 -0
  21. data/lib/plex_ruby_sdk/models/operations/get_search_all_libraries_episodesort.rb +19 -0
  22. data/lib/plex_ruby_sdk/models/operations/get_search_all_libraries_flattenseasons.rb +4 -3
  23. data/lib/plex_ruby_sdk/models/operations/get_search_all_libraries_metadata.rb +14 -8
  24. data/lib/plex_ruby_sdk/models/operations/get_search_all_libraries_request.rb +5 -5
  25. data/lib/plex_ruby_sdk/models/operations/get_search_all_libraries_showordering.rb +8 -8
  26. data/lib/plex_ruby_sdk/models/operations/get_search_library_queryparam_type.rb +2 -0
  27. data/lib/plex_ruby_sdk/models/operations/get_server_resources_request.rb +2 -2
  28. data/lib/plex_ruby_sdk/models/operations/getpin_request.rb +2 -2
  29. data/lib/plex_ruby_sdk/models/operations/getplaylistcontents_queryparam_type.rb +2 -0
  30. data/lib/plex_ruby_sdk/models/operations/getsessions_metadata.rb +5 -2
  31. data/lib/plex_ruby_sdk/models/operations/gettokenbypinid_request.rb +5 -5
  32. data/lib/plex_ruby_sdk/models/operations/gettopwatchedcontent_queryparam_type.rb +2 -0
  33. data/lib/plex_ruby_sdk/models/operations/post_users_sign_in_data_request.rb +2 -2
  34. data/lib/plex_ruby_sdk/models/operations/queryparam_type.rb +2 -0
  35. data/lib/plex_ruby_sdk/models/operations/showordering.rb +8 -8
  36. data/lib/plex_ruby_sdk/models/operations/tag.rb +1 -0
  37. data/lib/plex_ruby_sdk/models/operations/type.rb +2 -0
  38. data/lib/plex_ruby_sdk/models/operations.rb +6 -0
  39. data/lib/plex_ruby_sdk/playlists.rb +21 -18
  40. data/lib/plex_ruby_sdk/plex.rb +17 -11
  41. data/lib/plex_ruby_sdk/plex_api.rb +1 -32
  42. data/lib/plex_ruby_sdk/sdkconfiguration.rb +5 -7
  43. data/lib/plex_ruby_sdk/search.rb +6 -3
  44. data/lib/plex_ruby_sdk/server.rb +11 -2
  45. data/lib/plex_ruby_sdk/sessions.rb +6 -3
  46. data/lib/plex_ruby_sdk/statistics.rb +6 -3
  47. data/lib/plex_ruby_sdk/updater.rb +7 -3
  48. data/lib/plex_ruby_sdk/utils/utils.rb +3 -4
  49. data/lib/plex_ruby_sdk/video.rb +4 -2
  50. data/lib/plex_ruby_sdk/watchlist.rb +4 -4
  51. metadata +10 -4
@@ -32,7 +32,7 @@ module PlexRubySDK
32
32
  base_url = Utils.template_url(url, params)
33
33
  url = "#{base_url}/statistics/media"
34
34
  headers = {}
35
- query_params = Utils.get_query_params(::PlexRubySDK::Operations::GetStatisticsRequest, request, @sdk_configuration.globals)
35
+ query_params = Utils.get_query_params(::PlexRubySDK::Operations::GetStatisticsRequest, request)
36
36
  headers['Accept'] = 'application/json'
37
37
  headers['user-agent'] = @sdk_configuration.user_agent
38
38
 
@@ -63,6 +63,7 @@ module PlexRubySDK
63
63
  res.unauthorized = out
64
64
  end
65
65
  end
66
+
66
67
  res
67
68
  end
68
69
 
@@ -79,7 +80,7 @@ module PlexRubySDK
79
80
  base_url = Utils.template_url(url, params)
80
81
  url = "#{base_url}/statistics/resources"
81
82
  headers = {}
82
- query_params = Utils.get_query_params(::PlexRubySDK::Operations::GetResourcesStatisticsRequest, request, @sdk_configuration.globals)
83
+ query_params = Utils.get_query_params(::PlexRubySDK::Operations::GetResourcesStatisticsRequest, request)
83
84
  headers['Accept'] = 'application/json'
84
85
  headers['user-agent'] = @sdk_configuration.user_agent
85
86
 
@@ -110,6 +111,7 @@ module PlexRubySDK
110
111
  res.unauthorized = out
111
112
  end
112
113
  end
114
+
113
115
  res
114
116
  end
115
117
 
@@ -126,7 +128,7 @@ module PlexRubySDK
126
128
  base_url = Utils.template_url(url, params)
127
129
  url = "#{base_url}/statistics/bandwidth"
128
130
  headers = {}
129
- query_params = Utils.get_query_params(::PlexRubySDK::Operations::GetBandwidthStatisticsRequest, request, @sdk_configuration.globals)
131
+ query_params = Utils.get_query_params(::PlexRubySDK::Operations::GetBandwidthStatisticsRequest, request)
130
132
  headers['Accept'] = 'application/json'
131
133
  headers['user-agent'] = @sdk_configuration.user_agent
132
134
 
@@ -157,6 +159,7 @@ module PlexRubySDK
157
159
  res.unauthorized = out
158
160
  end
159
161
  end
162
+
160
163
  res
161
164
  end
162
165
  end
@@ -58,6 +58,7 @@ module PlexRubySDK
58
58
  res.unauthorized = out
59
59
  end
60
60
  end
61
+
61
62
  res
62
63
  end
63
64
 
@@ -74,7 +75,7 @@ module PlexRubySDK
74
75
  base_url = Utils.template_url(url, params)
75
76
  url = "#{base_url}/updater/check"
76
77
  headers = {}
77
- query_params = Utils.get_query_params(::PlexRubySDK::Operations::CheckForUpdatesRequest, request, @sdk_configuration.globals)
78
+ query_params = Utils.get_query_params(::PlexRubySDK::Operations::CheckForUpdatesRequest, request)
78
79
  headers['Accept'] = 'application/json'
79
80
  headers['user-agent'] = @sdk_configuration.user_agent
80
81
 
@@ -101,6 +102,7 @@ module PlexRubySDK
101
102
  res.unauthorized = out
102
103
  end
103
104
  end
105
+
104
106
  res
105
107
  end
106
108
 
@@ -119,7 +121,7 @@ module PlexRubySDK
119
121
  base_url = Utils.template_url(url, params)
120
122
  url = "#{base_url}/updater/apply"
121
123
  headers = {}
122
- query_params = Utils.get_query_params(::PlexRubySDK::Operations::ApplyUpdatesRequest, request, @sdk_configuration.globals)
124
+ query_params = Utils.get_query_params(::PlexRubySDK::Operations::ApplyUpdatesRequest, request)
123
125
  headers['Accept'] = 'application/json'
124
126
  headers['user-agent'] = @sdk_configuration.user_agent
125
127
 
@@ -134,7 +136,7 @@ module PlexRubySDK
134
136
  res = ::PlexRubySDK::Operations::ApplyUpdatesResponse.new(
135
137
  status_code: r.status, content_type: content_type, raw_response: r
136
138
  )
137
- if [200, 500].include?(r.status)
139
+ if r.status == 200
138
140
  elsif r.status == 400
139
141
  if Utils.match_content_type(content_type, 'application/json')
140
142
  out = Utils.unmarshal_complex(r.env.response_body, ::PlexRubySDK::Operations::ApplyUpdatesBadRequest)
@@ -145,7 +147,9 @@ module PlexRubySDK
145
147
  out = Utils.unmarshal_complex(r.env.response_body, ::PlexRubySDK::Operations::ApplyUpdatesUnauthorized)
146
148
  res.unauthorized = out
147
149
  end
150
+ elsif r.status == 500
148
151
  end
152
+
149
153
  res
150
154
  end
151
155
  end
@@ -358,7 +358,7 @@ module PlexRubySDK
358
358
 
359
359
  sig { params(content_type: String, pattern: String).returns(T::Boolean) }
360
360
  def self.match_content_type(content_type, pattern)
361
- return true if content_type == pattern || pattern == '*' || pattern == '*/*'
361
+ return true if content_type == pattern || ['*', '*/*'].include?(pattern)
362
362
 
363
363
  pieces = content_type.split(';')
364
364
  pieces.each do |piece|
@@ -593,7 +593,7 @@ module PlexRubySDK
593
593
  file_fields = val.fields
594
594
 
595
595
  file_name = ''
596
- field_name = ''
596
+ field_name = field_metadata[:field_name]
597
597
  content = nil
598
598
 
599
599
  file_fields.each do |file_field|
@@ -603,11 +603,10 @@ module PlexRubySDK
603
603
  if file_metadata[:content] == true
604
604
  content = val.send(file_field.name)
605
605
  else
606
- field_name = file_metadata.fetch(:field_name, file_field.name)
607
606
  file_name = val.send(file_field.name)
608
607
  end
609
608
  end
610
- raise StandardError, 'invalid multipart/form-data file' if field_name == '' || file_name == '' || content == nil?
609
+ raise StandardError, 'invalid multipart/form-data file' if file_name == '' || content == nil?
611
610
 
612
611
  form.append([field_name, [file_name, content]])
613
612
  elsif field_metadata[:json] == true
@@ -28,7 +28,7 @@ module PlexRubySDK
28
28
  base_url = Utils.template_url(url, params)
29
29
  url = "#{base_url}/:/timeline"
30
30
  headers = {}
31
- query_params = Utils.get_query_params(::PlexRubySDK::Operations::GetTimelineRequest, request, @sdk_configuration.globals)
31
+ query_params = Utils.get_query_params(::PlexRubySDK::Operations::GetTimelineRequest, request)
32
32
  headers['Accept'] = 'application/json'
33
33
  headers['user-agent'] = @sdk_configuration.user_agent
34
34
 
@@ -55,6 +55,7 @@ module PlexRubySDK
55
55
  res.unauthorized = out
56
56
  end
57
57
  end
58
+
58
59
  res
59
60
  end
60
61
 
@@ -67,7 +68,7 @@ module PlexRubySDK
67
68
  base_url = Utils.template_url(url, params)
68
69
  url = "#{base_url}/video/:/transcode/universal/start.mpd"
69
70
  headers = {}
70
- query_params = Utils.get_query_params(::PlexRubySDK::Operations::StartUniversalTranscodeRequest, request, @sdk_configuration.globals)
71
+ query_params = Utils.get_query_params(::PlexRubySDK::Operations::StartUniversalTranscodeRequest, request)
71
72
  headers['Accept'] = 'application/json'
72
73
  headers['user-agent'] = @sdk_configuration.user_agent
73
74
 
@@ -94,6 +95,7 @@ module PlexRubySDK
94
95
  res.unauthorized = out
95
96
  end
96
97
  end
98
+
97
99
  res
98
100
  end
99
101
  end
@@ -36,11 +36,10 @@ module PlexRubySDK
36
36
  ::PlexRubySDK::Operations::GetWatchListRequest,
37
37
  base_url,
38
38
  '/library/sections/watchlist/{filter}',
39
- request,
40
- @sdk_configuration.globals
39
+ request
41
40
  )
42
- headers = Utils.get_headers(request, @sdk_configuration.globals)
43
- query_params = Utils.get_query_params(::PlexRubySDK::Operations::GetWatchListRequest, request, @sdk_configuration.globals)
41
+ headers = Utils.get_headers(request)
42
+ query_params = Utils.get_query_params(::PlexRubySDK::Operations::GetWatchListRequest, request)
44
43
  headers['Accept'] = 'application/json'
45
44
  headers['user-agent'] = @sdk_configuration.user_agent
46
45
 
@@ -71,6 +70,7 @@ module PlexRubySDK
71
70
  res.unauthorized = out
72
71
  end
73
72
  end
73
+
74
74
  res
75
75
  end
76
76
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plex_ruby_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - LukeHagar
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-11-14 00:00:00.000000000 Z
11
+ date: 2025-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -67,7 +67,7 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: sorbet
70
+ name: sorbet-runtime
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ">="
@@ -109,7 +109,7 @@ dependencies:
109
109
  - !ruby/object:Gem::Version
110
110
  version: 1.60.2
111
111
  - !ruby/object:Gem::Dependency
112
- name: sorbet-runtime
112
+ name: sorbet
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - ">="
@@ -225,11 +225,13 @@ files:
225
225
  - lib/plex_ruby_sdk/models/operations/director.rb
226
226
  - lib/plex_ruby_sdk/models/operations/directory.rb
227
227
  - lib/plex_ruby_sdk/models/operations/download.rb
228
+ - lib/plex_ruby_sdk/models/operations/enablecreditsmarkergeneration.rb
228
229
  - lib/plex_ruby_sdk/models/operations/enablepapertrail_badrequest.rb
229
230
  - lib/plex_ruby_sdk/models/operations/enablepapertrail_errors.rb
230
231
  - lib/plex_ruby_sdk/models/operations/enablepapertrail_log_errors.rb
231
232
  - lib/plex_ruby_sdk/models/operations/enablepapertrail_response.rb
232
233
  - lib/plex_ruby_sdk/models/operations/enablepapertrail_unauthorized.rb
234
+ - lib/plex_ruby_sdk/models/operations/episodesort.rb
233
235
  - lib/plex_ruby_sdk/models/operations/errors.rb
234
236
  - lib/plex_ruby_sdk/models/operations/feature.rb
235
237
  - lib/plex_ruby_sdk/models/operations/field.rb
@@ -276,6 +278,8 @@ files:
276
278
  - lib/plex_ruby_sdk/models/operations/get_library_items_country.rb
277
279
  - lib/plex_ruby_sdk/models/operations/get_library_items_defaultdirection.rb
278
280
  - lib/plex_ruby_sdk/models/operations/get_library_items_director.rb
281
+ - lib/plex_ruby_sdk/models/operations/get_library_items_enablecreditsmarkergeneration.rb
282
+ - lib/plex_ruby_sdk/models/operations/get_library_items_episodesort.rb
279
283
  - lib/plex_ruby_sdk/models/operations/get_library_items_errors.rb
280
284
  - lib/plex_ruby_sdk/models/operations/get_library_items_field.rb
281
285
  - lib/plex_ruby_sdk/models/operations/get_library_items_fieldtype.rb
@@ -388,6 +392,8 @@ files:
388
392
  - lib/plex_ruby_sdk/models/operations/get_search_all_libraries_collection.rb
389
393
  - lib/plex_ruby_sdk/models/operations/get_search_all_libraries_country.rb
390
394
  - lib/plex_ruby_sdk/models/operations/get_search_all_libraries_director.rb
395
+ - lib/plex_ruby_sdk/models/operations/get_search_all_libraries_enablecreditsmarkergeneration.rb
396
+ - lib/plex_ruby_sdk/models/operations/get_search_all_libraries_episodesort.rb
391
397
  - lib/plex_ruby_sdk/models/operations/get_search_all_libraries_errors.rb
392
398
  - lib/plex_ruby_sdk/models/operations/get_search_all_libraries_flattenseasons.rb
393
399
  - lib/plex_ruby_sdk/models/operations/get_search_all_libraries_genre.rb