mza921 / Plex-Auto-Collections

Python 3 script to automatically update Plex collections based off a configuration file
309 stars 28 forks source link

Summary no longer being set. #27

Closed JourneyOver closed 4 years ago

JourneyOver commented 4 years ago

Script no longer sets the summary. I've tried both tmdb-summary with the correct collections page's ID and I've tried the normal summary with the summary text after, doing either sets the summary temporarily but upon doing anything in plex (going to a different movie or show or to the home page / clicking the edit button for the movie / etc) or exiting the script it removes the summary from the collection.

I am running plex version 1.20.0.3125 but this has been going on for several versions now.

burkasaurusrex commented 4 years ago

yea, if you don't mind splitting the issues, that would be helpful

JourneyOver commented 4 years ago

Done @burkasaurusrex .. sorry it took 3 hours to get back to this, quickly whipped this up right before I had to leave for work.

burkasaurusrex commented 4 years ago

Thanks. Do you mind running pip show tmdbv3api and posting the output here?

JourneyOver commented 4 years ago
Name: tmdbv3api
Version: 1.5.1
Summary: A lightweight Python library for The Movie Database (TMDb) API.
Home-page: https://github.com/AnthonyBloomer/tmdbv3api
Author: Anthony Bloomer
Author-email: ant0@protonmail.ch
License: MIT
Location: c:\tools\python3\lib\site-packages
Requires: requests
Required-by:

Could it be something to do with python version by chance? as I am running python version 3.8.3

burkasaurusrex commented 4 years ago

Yea, might be the python version - can you test on 3.7.x? Alternatively, if you want to give the docker a try here: https://hub.docker.com/r/burkasaurusrex/plex-auto-collections

burkasaurusrex commented 4 years ago

Actually, I'm using 3.8 on Windows right now without any problem. Do you mind sharing the relevant snippet of YAML?

JourneyOver commented 4 years ago

Two examples:

collections:
  47 Meters Down:
    tmdb-list: https://www.themoviedb.org/collection/635922
    details:
      tmdb-summary: 635922

doesn't work and

collections:
  47 Meters Down:
    tmdb-list: https://www.themoviedb.org/collection/635922
    details:
      summary: A series of survival horror films, where the plot is based on surviving and escaping sharks.

doesn't work

They both temporarily set the summary, but upon exiting the script or doing anything in plex the summary disappears.

JourneyOver commented 4 years ago

Hopefully we can get both this and #28 figured out fully, as I would really like to set this up again.

Should I be watching this repo, or your fork for any possible fixes @burkasaurusrex ?

also to note: I sadly can't run anything to do with docker due to a couple programs that I run. So spinning up docker and all that sadly isn't possible.

burkasaurusrex commented 4 years ago

I think #28 will be an easy fix. This feels tougher to fix - seems like the script might not be functioning properly in your specific environment. Do you mind posting the output of this as well? pip show PlexAPI

JourneyOver commented 4 years ago

Which is strange because it used to work a long time ago just fine, and nothing has really changed other than me updating this script and keeping plex up to date as well.. What I find really strange though is that it's adding the summary to the collection like it should but it's only there temporarily before disappearing..

Name: PlexAPI
Version: 4.0.0
Summary: Python bindings for the Plex API.
Home-page: https://github.com/pkkid/python-plexapi
Author: Michael Shepanski
Author-email: michael.shepanski@gmail.com
License: UNKNOWN
Location: c:\tools\python3\lib\site-packages
Requires: requests
Required-by:
burkasaurusrex commented 4 years ago

Maybe try opening the Plex console (Settings > Manage > Console) then running the script to see if Plex is throwing any errors?

JourneyOver commented 4 years ago

Don't see any errors in the console, I even filtered for errors and there was 0.

I did filter for summary as well to see what would come up for summary in the console and all I got was https://i.imgur.com/bdP3z7P.png

there doesn't seem to be a way to save the console sadly :/ otherwise I would grab it all save it to a .txt file and throw it up and see if you could make out anything..

JourneyOver commented 4 years ago

Actually here is my log.. I believe I've taken everything out of it that I need to hide, but let me know when you get it so that I can remove the link and delete make an edit to delete the revision so the link no longer shows up @burkasaurusrex

[link has been removed for the log]

burkasaurusrex commented 4 years ago

Welp. The request is clearly being completed by Plex successfully:

Jul 25, 2020 03:35:49.147 [23604] DEBUG - Request: [127.0.0.1:22140 (Loopback)] PUT /library/sections/2/all?type=18&id=17828&summary.value=A+series+of+survival+horror+films%2C+where+the+plot+is+based+on+surviving+and+escaping+sharks. (20 live) GZIP Signed-in Token (JourneyOver)
Jul 25, 2020 03:35:49.148 [11968] DEBUG - Completed: [127.0.0.1:22140] 200 PUT /library/sections/2/all?type=18&id=17828&summary.value=A+series+of+survival+horror+films%2C+where+the+plot+is+based+on+surviving+and+escaping+sharks. (20 live) GZIP 0ms 195 bytes (pipelined: 1)
Jul 25, 2020 03:35:49.149 [11672] DEBUG - Auth: authenticated user 1 as JourneyOver
Jul 25, 2020 03:35:49.149 [23604] DEBUG - Request: [127.0.0.1:22141 (Loopback)] POST /library/metadata/17828/posters?url=https%3A%2F%2Fi.imgur.com%2FIz5pIsU.jpg (20 live) GZIP Signed-in Token (JourneyOver)
Jul 25, 2020 03:35:49.150 [23604] DEBUG - Downloading media asset from https://i.imgur.com/Iz5pIsU.jpg
Jul 25, 2020 03:35:49.150 [23604] DEBUG - HTTP requesting GET https://i.imgur.com/Iz5pIsU.jpg
Jul 25, 2020 03:35:49.155 [11968] DEBUG - Auth: authenticated user 1 as JourneyOver

But then some activity is triggered that is very vague:

Jul 25, 2020 03:35:49.157 [1736] DEBUG - Activity: registered new activity 6040a2e0-78cd-4cb7-874f-66f4b46076cb - Refreshing
Jul 25, 2020 03:35:49.157 [8140] DEBUG - Activity: registered new activity 448a8664-ed10-4e89-bada-6be3d22e71a2 - Refreshing
Jul 25, 2020 03:35:49.157 [18160] DEBUG - Activity: updated activity 6040a2e0-78cd-4cb7-874f-66f4b46076cb - completed 0.0% - Refreshing
Jul 25, 2020 03:35:49.157 [16672] DEBUG - Activity: updated activity 448a8664-ed10-4e89-bada-6be3d22e71a2 - completed 0.0% - Refreshing
Jul 25, 2020 03:35:49.157 [16672] DEBUG - Activity: updated activity 448a8664-ed10-4e89-bada-6be3d22e71a2 - completed 33.0% - Refreshing
Jul 25, 2020 03:35:49.157 [23988] DEBUG - Collections: Refreshed attributes for 1 collections in section 2 in 1ms.
Jul 25, 2020 03:35:49.157 [16672] DEBUG - Activity: updated activity 448a8664-ed10-4e89-bada-6be3d22e71a2 - completed 66.0% - Refreshing
Jul 25, 2020 03:35:49.157 [18160] DEBUG - Activity: updated activity 6040a2e0-78cd-4cb7-874f-66f4b46076cb - completed 33.0% - Refreshing
Jul 25, 2020 03:35:49.158 [18160] DEBUG - Activity: updated activity 6040a2e0-78cd-4cb7-874f-66f4b46076cb - completed 66.0% - Refreshing
Jul 25, 2020 03:35:49.158 [16672] DEBUG - Activity: Ended activity 448a8664-ed10-4e89-bada-6be3d22e71a2.
Jul 25, 2020 03:35:49.158 [18160] DEBUG - Activity: Ended activity 6040a2e0-78cd-4cb7-874f-66f4b46076cb.
Jul 25, 2020 03:35:49.158 [2832] DEBUG - Collections: Refreshed attributes for 1 collections in section 2 in 1ms.

Can you go into the library (Manage Library > Edit ... > Advanced) and scroll to the bottom to make sure that Use collection info from The Movie Database is not set?

JourneyOver commented 4 years ago

Nope it's not set, I disabled that option when collections first came out because I was annoyed that it was creating 1 movie collections.

I think what the activity thing is, is that every time I run the script it seems to run a refresh on the movies that was added to that collection.

burkasaurusrex commented 4 years ago

I just did some testing on my machine and I'm not getting the subsequent activity. Can you search for those guids (6040a2e0-78cd-4cb7-874f-66f4b46076cb and 448a8664-ed10-4e89-bada-6be3d22e71a2) in all of the other Plex logs? Namely the metadata scanner.

burkasaurusrex commented 4 years ago

Wait, this is Plex version 1.20.0.3125? That is a Plex Pass beta version, no? Did you upgrade the library to the new metadata scanner? Are you running Plex on a QNAP by chance? https://forums.plex.tv/t/collections-broken-after-1-20-0-3125-update-on-qnap-tvs-682/616565

I'd recommend downgrading to a stable version and trying again.

JourneyOver commented 4 years ago

I just did some testing on my machine and I'm not getting the subsequent activity. Can you search for those guids (6040a2e0-78cd-4cb7-874f-66f4b46076cb and 448a8664-ed10-4e89-bada-6be3d22e71a2) in all of the other Plex logs? Namely the metadata scanner.

I had deleted all logs prior to the one from yesterday to get a completely fresh log to provide to you so I sadly don't have a metadata scanner log from the looks of it, at least I don't see one in the logs folder. I did scan for those two guids though in all the current logs I have and no trace other than the few bits from the log that I gave you yesterday are found.

The guids seem to change every time I run the plex server or run the script it seems, as I just did a test now and I have brand new guids.

Wait, this is Plex version 1.20.0.3125? That is a Plex Pass beta version, no? Did you upgrade the library to the new metadata scanner? Are you running Plex on a QNAP by chance? forums.plex.tv/t/collections-broken-after-1-20-0-3125-update-on-qnap-tvs-682/616565

I'd recommend downgrading to a stable version and trying again.

Yes I'm currently running 1.20.0.3125 but this has been happening for a while now. I actually just checked and the last time I had a successful run with no issues was back in February (going by commits I have made to my own repository), and it seems the issues cropped up last month before I fully noticed which initiated this and my other issue which I would of been running version 1.19.4.2935 at the time.

Not running plex on QNAP or any server type machines, just running the server on my daily PC which is running windows 10.

I haven't updated the library to the new metadata scanner and I don't plan on doing so due to the fact that I have plugins (mainly the trakt plugin) that doesn't work with the new metadata scanner and probably never will since it no longer receives updates.

which talking about the trakt plugin honestly I feel like just giving up on this issue, moving to either emby or jellyfin (siding with jellyfin more) and just no longer use plex anymore due to plugins dying off slowly for plex anyways..

burkasaurusrex commented 4 years ago

If you make a manual change to a collection's metadata, does it persist or does it revert?

JourneyOver commented 4 years ago

so I actually never checked that till now.. and funny thing is, is that the summary is the only one that doesn't stick if I manually change any of the collections metadata through plex.

I checked the chrome dev console to see if there was any clues possibly and whenever I click the save changes button it throws this warning:

chunk-3-a6f6c5f066aa0f84a841-plex-4.34.4-7d609a3.js:9 An entity does not exist with the type "providers" and id "undefined"
onLogMessage @ chunk-3-a6f6c5f066aa0f84a841-plex-4.34.4-7d609a3.js:9
onLog @ chunk-3-a6f6c5f066aa0f84a841-plex-4.34.4-7d609a3.js:9
o @ chunk-3-a6f6c5f066aa0f84a841-plex-4.34.4-7d609a3.js:9
trigger @ chunk-3-a6f6c5f066aa0f84a841-plex-4.34.4-7d609a3.js:9
(anonymous) @ chunk-3-a6f6c5f066aa0f84a841-plex-4.34.4-7d609a3.js:9
n @ chunk-3-a6f6c5f066aa0f84a841-plex-4.34.4-7d609a3.js:9
d @ chunk-3-a6f6c5f066aa0f84a841-plex-4.34.4-7d609a3.js:9
ui/repopulatePage @ chunk-3-a6f6c5f066aa0f84a841-plex-4.34.4-7d609a3.js:9
e @ chunk-3-a6f6c5f066aa0f84a841-plex-4.34.4-7d609a3.js:9
(anonymous) @ chunk-3-a6f6c5f066aa0f84a841-plex-4.34.4-7d609a3.js:9
l @ chunk-5-3ee08078895dfbdf0b07-plex-4.34.4-7d609a3.js:45
fireWith @ chunk-5-3ee08078895dfbdf0b07-plex-4.34.4-7d609a3.js:45
(anonymous) @ chunk-5-3ee08078895dfbdf0b07-plex-4.34.4-7d609a3.js:45
l @ chunk-5-3ee08078895dfbdf0b07-plex-4.34.4-7d609a3.js:45
fireWith @ chunk-5-3ee08078895dfbdf0b07-plex-4.34.4-7d609a3.js:45
x @ chunk-5-3ee08078895dfbdf0b07-plex-4.34.4-7d609a3.js:45
(anonymous) @ chunk-5-3ee08078895dfbdf0b07-plex-4.34.4-7d609a3.js:45
r @ chunk-5-3ee08078895dfbdf0b07-plex-4.34.4-7d609a3.js:91
load (async)
n @ chunk-5-3ee08078895dfbdf0b07-plex-4.34.4-7d609a3.js:91
(anonymous) @ chunk-5-3ee08078895dfbdf0b07-plex-4.34.4-7d609a3.js:91
i @ chunk-5-3ee08078895dfbdf0b07-plex-4.34.4-7d609a3.js:91
send @ chunk-5-3ee08078895dfbdf0b07-plex-4.34.4-7d609a3.js:45
ajax @ chunk-5-3ee08078895dfbdf0b07-plex-4.34.4-7d609a3.js:45
t.ajax @ chunk-3-a6f6c5f066aa0f84a841-plex-4.34.4-7d609a3.js:9
t.sync @ chunk-3-a6f6c5f066aa0f84a841-plex-4.34.4-7d609a3.js:9
g.sync @ chunk-3-a6f6c5f066aa0f84a841-plex-4.34.4-7d609a3.js:9
sync @ chunk-3-a6f6c5f066aa0f84a841-plex-4.34.4-7d609a3.js:9
sync @ chunk-3-a6f6c5f066aa0f84a841-plex-4.34.4-7d609a3.js:9
save @ chunk-3-a6f6c5f066aa0f84a841-plex-4.34.4-7d609a3.js:9
save @ chunk-3-a6f6c5f066aa0f84a841-plex-4.34.4-7d609a3.js:9
(anonymous) @ chunk-3-a6f6c5f066aa0f84a841-plex-4.34.4-7d609a3.js:9
l @ chunk-5-3ee08078895dfbdf0b07-plex-4.34.4-7d609a3.js:45
add @ chunk-5-3ee08078895dfbdf0b07-plex-4.34.4-7d609a3.js:45
saveChanges @ chunk-3-a6f6c5f066aa0f84a841-plex-4.34.4-7d609a3.js:9
(anonymous) @ chunk-3-a6f6c5f066aa0f84a841-plex-4.34.4-7d609a3.js:1
(anonymous) @ chunk-5-3ee08078895dfbdf0b07-plex-4.34.4-7d609a3.js:60
r @ chunk-5-3ee08078895dfbdf0b07-plex-4.34.4-7d609a3.js:91
setTimeout (async)
(anonymous) @ chunk-5-3ee08078895dfbdf0b07-plex-4.34.4-7d609a3.js:91
F/us.m.delay @ chunk-5-3ee08078895dfbdf0b07-plex-4.34.4-7d609a3.js:60
D @ chunk-5-3ee08078895dfbdf0b07-plex-4.34.4-7d609a3.js:60
n @ chunk-5-3ee08078895dfbdf0b07-plex-4.34.4-7d609a3.js:60
(anonymous) @ chunk-3-a6f6c5f066aa0f84a841-plex-4.34.4-7d609a3.js:1
onFormSubmit @ chunk-3-a6f6c5f066aa0f84a841-plex-4.34.4-7d609a3.js:9
dispatch @ chunk-5-3ee08078895dfbdf0b07-plex-4.34.4-7d609a3.js:45
m.handle @ chunk-5-3ee08078895dfbdf0b07-plex-4.34.4-7d609a3.js:45
r @ chunk-5-3ee08078895dfbdf0b07-plex-4.34.4-7d609a3.js:91

it seems to throw that message for any edit I do though not just the summary, but the summary is the only one that the changes won't stick for.

burkasaurusrex commented 4 years ago

Ok, this is clearly a Plex issue, most likely related to the early access / beta version of Plex Media Server. I'd recommend going through Plex forums for support on the issue (it looks like there are other posts related to this problem for this version) and reverting to non-Plex Pass version of the Plex Media Server if you'd like to use this script.

JourneyOver commented 4 years ago

Well seems that I finally fixed it. I completely removed the entire movie library and re-added it in a last attempt of trying to get this stuff to work before giving up and the script started working again fully.

so guess I'm closing this.