Drewpeifer / medialytics

A basic, free tool that shows information about Plex Media Server content
GNU General Public License v3.0
112 stars 9 forks source link

Charts for decade and studio statistics not generating #1

Closed Mascha11 closed 1 year ago

Mascha11 commented 3 years ago

Hey there, I've just stumbled upon your tool and as an statistics nerd I absolutely love it, but sadly when I use it I see everything except the charts for "Movies By Decade", "TV Shows By Decade", "Movies By Studio (Top 50)" and "TV Shows By Studio (Top 50)". Could you maybe help me fix this problem, so I can use your amazing tool to its full potential? Thank you very much in advance. medialytics_screenshot

Drewpeifer commented 3 years ago

I'm glad you're enjoying it! Sorry for the trouble though, it is strange that you are seeing the genre chart but not the other charts. I'm not sure what the issue is off the top of my head, but you might get some useful info from the JS console (right-click and then select "inspect" or "developer tools" depending on your browser, then access the "console" tab). You might need to refresh with the console open to trigger the error, if there is one.

If the error displayed isn't helpful, or if there aren't any errors, the next step would be to go into scripts.js on line 219 where it says // movies by decade chart and add 2 new lines right before the $.each() statement:

console.dir(jsonData); console.dir(releaseDateList);

Then refresh the page (with the console open) and the first line should print your entire movies payload, and the second should print the list of release dates for the first chart you're missing (Movies by Decade). I would debug each chart that is missing that way, comparing the payload from jsonData to the actual object being passed to the C3 chart.

My guess would be that either there is a difference between the XML/JSON structure of our libraries (and you'll have to edit the code to match your XML structure), or you've run into an edge case I haven't found yet (like a movie that's has two release years or something weird, etc.).

Sorry again for the trouble, and let me know if I can be of any more help. Good luck!

Drewpeifer commented 3 years ago

@Mascha11 Just FYI, I've made some recent changes that deal with some NaN cases as well as fixing a scenario where the server payload would contain a node that was just line breaks(?). The API is not perfect, so there may be more edge cases to find, but maybe one of these will solve (or help diagnose) your issue.

Drewpeifer commented 1 year ago

Closing this due to the age of the post, recent updates may have solved the problem but please open a new issue if the problem persists.