Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When using plex_search, if studio value isn't found every show gets added to collection #199

Closed
ngInit opened this issue Apr 10, 2021 · 10 comments · Fixed by #211
Closed
Assignees
Labels
bug Bug is with Plex Meta Manager

Comments

@ngInit
Copy link

ngInit commented Apr 10, 2021

For some reason one of my studio collections went MIA today and is no longer available. Because of this, the collection I created errors/warns me:

Plex Error: studio ___ not found
Collection Warning: No valid studio values found in ___

And then proceeds to fill every existing show in the collection.

@meisnate12
Copy link
Member

There's a fix for this in develop

@ngInit
Copy link
Author

ngInit commented Apr 11, 2021

I just pulled develop and I'm still having this issue. When I run the script it says it's running Version 1.7.2

@meisnate12
Copy link
Member

in develop when i run

collections:
  +TEST:
    plex_search:
      studio: i dont have this in plex

the output is

|====================================================================================================|
|                                          +TEST Collection                                          |
|====================================================================================================|
|                                                                                                    |
| Scanning +TEST Collection                                                                          |
|                                                                                                    |
| Validating Method: plex_search                                                                     |
| Value: ordereddict([('studio', 'i dont have this in plex')])                                       |
| Plex Error: studio: i dont have this in plex not found                                             |
| Collection Warning: No valid studio values found in i dont have this in plex                       |
| Collection Error: no valid plex search attributes                                                  |
|                                                                                                    |
|====================================================================================================|

do you see version 1.7.2-Beta1 at the start of your run that's the current version in develop

@ngInit
Copy link
Author

ngInit commented Apr 11, 2021

I didn't see that - I found the issue though. I had only upgraded my docker-compose version to develop, the command I was using was still on master.

There's something else breaking in this new branch though.

I get this error now:

|====================================================================================================|
|                                       Shows Library Metadata                                       |
|====================================================================================================|
|                                                                                                    |
|                                                                                                    |
|====================================================================================================|
|                                                                                                    |
| int() argument must be a string, a bytes-like object or a number, not 'NoneType'                   |
|                                                                                                    |
|====================================================================================================|
|                                            Finished Run                                            |
|                                         Run Time: 0:00:57                                          |
|====================================================================================================|

Switching back to master, everything works as expected.

@meisnate12
Copy link
Member

Can you look in your meta.log file and post the trace back printing just before this line in the log

@ngInit
Copy link
Author

ngInit commented Apr 11, 2021

[2021-04-11 18:13:34,125] [util.py:356]               [INFO]     |====================================================================================================|
[2021-04-11 18:13:34,125] [util.py:360]               [INFO]     |                                       Shows Library Metadata                                       |
[2021-04-11 18:13:34,125] [util.py:361]               [INFO]     |====================================================================================================|
[2021-04-11 18:13:34,125] [plex.py:468]               [INFO]     |                                                                                                    |
[2021-04-11 18:13:34,125] [plex.py:475]               [INFO]     |                                                                                                    |
[2021-04-11 18:13:34,125] [util.py:356]               [INFO]     |====================================================================================================|
[2021-04-11 18:13:34,125] [plex.py:477]               [INFO]     |                                                                                                    |
[2021-04-11 18:14:24,187] [util.py:313]               [DEBUG]    | Traceback (most recent call last):                                                                 |
                                                                 |   File "//plex_meta_manager.py", line 108, in start
                                                                 |     config.update_libraries(is_test, collections_to_run, resume_from)
                                                                 |   File "/modules/config.py", line 453, in update_libraries
                                                                 |     try:                        library.update_metadata(self.TMDb, test)
                                                                 |   File "/modules/plex.py", line 487, in update_metadata
                                                                 |     item = self.search_item(title, year=year)
                                                                 |   File "/modules/plex.py", line 463, in search_item
                                                                 |     return util.choose_from_list(self.search(data, year=year), "movie" if self.is_movie else "show", str(data), exact=True)
                                                                 |   File "/usr/local/lib/python3.9/site-packages/retrying.py", line 49, in wrapped_f
                                                                 |     return Retrying(*dargs, **dkw).call(f, *args, **kw)
                                                                 |   File "/usr/local/lib/python3.9/site-packages/retrying.py", line 212, in call
                                                                 |     raise attempt.get()
                                                                 |   File "/usr/local/lib/python3.9/site-packages/retrying.py", line 247, in get
                                                                 |     six.reraise(self.value[0], self.value[1], self.value[2])
                                                                 |   File "/usr/local/lib/python3.9/site-packages/six.py", line 703, in reraise
                                                                 |     raise value
                                                                 |   File "/usr/local/lib/python3.9/site-packages/retrying.py", line 200, in call
                                                                 |     attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
                                                                 |   File "/modules/plex.py", line 186, in search
                                                                 |     return self.Plex.search(title=title, sort=sort, maxresults=maxresults, libtype=libtype, **kwargs)
                                                                 |   File "/usr/local/lib/python3.9/site-packages/plexapi/library.py", line 1128, in search
                                                                 |     filter_args.append(self._validateFilterField(field, values, libtype))
                                                                 |   File "/usr/local/lib/python3.9/site-packages/plexapi/library.py", line 801, in _validateFilterField
                                                                 |     result = self._validateFieldValue(filterField, values, libtype)
                                                                 |   File "/usr/local/lib/python3.9/site-packages/plexapi/library.py", line 857, in _validateFieldValue
                                                                 |     value = int(value)
                                                                 | TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
                                                                 | 
[2021-04-11 18:14:24,188] [plex_meta_manager.py:111]  [CRITICAL] | int() argument must be a string, a bytes-like object or a number, not 'NoneType'
[2021-04-11 18:14:24,188] [plex_meta_manager.py:112]  [INFO]     | 
[2021-04-11 18:14:24,188] [util.py:356]               [INFO]     |====================================================================================================|
[2021-04-11 18:14:24,188] [util.py:360]               [INFO]     |                                            Finished Run                                            |
[2021-04-11 18:14:24,188] [util.py:360]               [INFO]     |                                         Run Time: 0:00:57                                          |
[2021-04-11 18:14:24,188] [util.py:361]               [INFO]     |====================================================================================================|

meisnate12 added a commit that referenced this issue Apr 12, 2021
@meisnate12
Copy link
Member

ok fixed that issue it was unrelated to the collection so update develop and try again

@ngInit
Copy link
Author

ngInit commented Apr 12, 2021

Thanks! The int argument error is fixed, and missing studio values are fixed.

I'm seeing that same error the studio value had when a genre isn't found. And if that's happening, then it probably happens with others I haven't tested too

Also, it doesn't look like changing the title of the Special season works.

YML:

metadata:
  "Series Name":
    seasons:
      0:
        title: Test-Title

Error:

[2021-04-12 06:18:06,590] [plex.py:677]               [DEBUG]    | Season: 0 Details Update: {'title.value': 'Test-Title', 'title.locked': 1}                           |
[2021-04-12 06:18:06,602] [util.py:313]               [DEBUG]    | Traceback (most recent call last):                                                                 |
                                                                 |   File "//plex_meta_manager.py", line 108, in start
                                                                 |     config.update_libraries(is_test, collections_to_run, resume_from)
                                                                 |   File "/modules/config.py", line 453, in update_libraries
                                                                 |     try:                        library.update_metadata(self.TMDb, test)
                                                                 |   File "/modules/plex.py", line 680, in update_metadata
                                                                 |     season.edit(**edits)
                                                                 |   File "/usr/local/lib/python3.9/site-packages/plexapi/base.py", line 497, in edit
                                                                 |     self._server.query(part, method=self._server._session.put)
                                                                 |   File "/usr/local/lib/python3.9/site-packages/plexapi/server.py", line 531, in query
                                                                 |     raise NotFound(message)
                                                                 | plexapi.exceptions.NotFound: (404) not_found; https://plex.hostname.com/library/sections/None/all?title.value=Test-Title&title.locked=1&id=209332&type=4 <html><head><title>Not Found</title></head><body><h1>404 Not Found</h1></body></html>
                                                                 | 
[2021-04-12 06:18:06,603] [plex_meta_manager.py:111]  [CRITICAL] | (404) not_found; https://plex.hostname.com/library/sections/None/all?title.value=Test-Title&title.locked=1&id=209332&type=4 <html><head><title>Not Found</title></head><body><h1>404 Not Found</h1></body></html>
[2021-04-12 06:18:06,603] [plex_meta_manager.py:112]  [INFO]     | 

@meisnate12
Copy link
Member

meisnate12 commented Apr 14, 2021

this is actually a bug in the plexAPI i fixed it you can follow the Pull Request pkkid/python-plexapi/pull/725

meisnate12 added a commit that referenced this issue Apr 14, 2021
@meisnate12
Copy link
Member

added a workaround in develop so it should be good now

@meisnate12 meisnate12 self-assigned this Apr 14, 2021
@meisnate12 meisnate12 added the bug Bug is with Plex Meta Manager label Apr 14, 2021
@meisnate12 meisnate12 mentioned this issue Apr 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug is with Plex Meta Manager
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants