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

Tautulli Popular error when Plex has music #63

Closed
bobokun opened this issue Feb 24, 2021 · 5 comments · Fixed by #122
Closed

Tautulli Popular error when Plex has music #63

bobokun opened this issue Feb 24, 2021 · 5 comments · Fixed by #122
Assignees
Labels
bug Bug is with Plex Meta Manager

Comments

@bobokun
Copy link

bobokun commented Feb 24, 2021

I noticed an error when creating the Plex Popular collection using tautulli, I think it is due to having music in my library.
I only have movie in my config.yml so I'm not sure why tautulli picks up music as well.

Config.yml

libraries:
  Movies:
    library_type: movie

Movies.yml

templates:
  Chart Alpha:
    sort_title: ++++_<<num>><<collection_name>>
    sync_mode: sync
    collection_order: alpha

  Plex Popular:
    template: {name: Chart Alpha, num: 1}
    tautulli_popular:
      list_days: 30
      list_size: 20
      list_buffer: 20
    tautulli_watched:
      list_days: 30
      list_size: 20
      list_buffer: 20
    summary: Movies Popular on Plex

Error logs:

[2021-02-24 00:30:12,534] [util.py:637]               [INFO]     |====================================================================================================|
[2021-02-24 00:30:12,534] [util.py:639]               [INFO]     |                                      Plex Popular Collection                                       |
[2021-02-24 00:30:12,534] [util.py:640]               [INFO]     |====================================================================================================|
[2021-02-24 00:30:12,534] [config.py:370]             [INFO]     |                                                                                                    |
[2021-02-24 00:30:12,534] [builder.py:167]            [INFO]     | Scanning Plex Popular Collection                                                                   |
[2021-02-24 00:30:12,534] [builder.py:199]            [DEBUG]    |                                                                                                    |
[2021-02-24 00:30:12,534] [builder.py:200]            [DEBUG]    | Method: template                                                                                   |
[2021-02-24 00:30:12,534] [builder.py:201]            [DEBUG]    | Value: ordereddict([('name', 'Chart Alpha'), ('num', 1)])                                          |
[2021-02-24 00:30:12,535] [builder.py:199]            [DEBUG]    |                                                                                                    |
[2021-02-24 00:30:12,535] [builder.py:200]            [DEBUG]    | Method: tautulli_popular                                                                           |
[2021-02-24 00:30:12,535] [builder.py:201]            [DEBUG]    | Value: ordereddict([('list_days', 30), ('list_size', 20), ('list_buffer', 20)])                    |
[2021-02-24 00:30:12,535] [builder.py:199]            [DEBUG]    |                                                                                                    |
[2021-02-24 00:30:12,535] [builder.py:200]            [DEBUG]    | Method: tautulli_watched                                                                           |
[2021-02-24 00:30:12,535] [builder.py:201]            [DEBUG]    | Value: ordereddict([('list_days', 30), ('list_size', 20), ('list_buffer', 20)])                    |
[2021-02-24 00:30:12,535] [builder.py:199]            [DEBUG]    |                                                                                                    |
[2021-02-24 00:30:12,535] [builder.py:200]            [DEBUG]    | Method: summary                                                                                    |
[2021-02-24 00:30:12,536] [builder.py:201]            [DEBUG]    | Value: Movies Popular on Plex                                                                      |
[2021-02-24 00:30:12,536] [builder.py:199]            [DEBUG]    |                                                                                                    |
[2021-02-24 00:30:12,536] [builder.py:200]            [DEBUG]    | Method: sort_title                                                                                 |
[2021-02-24 00:30:12,536] [builder.py:201]            [DEBUG]    | Value: ++++_1Plex Popular                                                                          |
[2021-02-24 00:30:12,536] [builder.py:199]            [DEBUG]    |                                                                                                    |
[2021-02-24 00:30:12,536] [builder.py:200]            [DEBUG]    | Method: sync_mode                                                                                  |
[2021-02-24 00:30:12,536] [builder.py:201]            [DEBUG]    | Value: sync                                                                                        |
[2021-02-24 00:30:12,536] [builder.py:199]            [DEBUG]    |                                                                                                    |
[2021-02-24 00:30:12,537] [builder.py:200]            [DEBUG]    | Method: collection_order                                                                           |
[2021-02-24 00:30:12,537] [builder.py:201]            [DEBUG]    | Value: alpha                                                                                       |
[2021-02-24 00:30:12,542] [config.py:390]             [INFO]     |                                                                                                    |
[2021-02-24 00:30:12,543] [config.py:392]             [INFO]     | Sync Mode: sync                                                                                    |
[2021-02-24 00:30:12,685] [builder.py:529]            [DEBUG]    |                                                                                                    |
[2021-02-24 00:30:12,685] [builder.py:530]            [DEBUG]    | Method: tautulli_popular                                                                           |
[2021-02-24 00:30:12,685] [builder.py:531]            [DEBUG]    | Values: [{'list_type': 'popular', 'list_days': 30, 'list_size': 20, 'list_buffer': 20}]            |
[2021-02-24 00:30:12,686] [builder.py:551]            [INFO]     |                                                                                                    |
[2021-02-24 00:30:12,686] [builder.py:552]            [DEBUG]    | Value: {'list_type': 'popular', 'list_days': 30, 'list_size': 20, 'list_buffer': 20}               |
[2021-02-24 00:30:12,686] [tautulli.py:28]            [INFO]     | Processing Tautulli Most Popular: 20 Movies                                                        |
[2021-02-24 00:30:12,686] [tautulli.py:61]            [DEBUG]    | Tautulli URL: http://10.0.0.10:8181/api/v2?apikey=################################&cmd=get_home_stats&time_range=30&stats_count=40 |
[2021-02-24 00:30:12,984] [tautulli.py:61]            [DEBUG]    | Tautulli URL: http://10.0.0.10:8181/api/v2?apikey=################################&cmd=get_library_names |
[2021-02-24 00:30:13,131] [util.py:649]               [INFO]     | Plex Popular Collection | = | The White Tiger                                                      |
[2021-02-24 00:30:13,155] [util.py:649]               [INFO]     | Plex Popular Collection | = | Wrong Turn                                                           |
[2021-02-24 00:30:13,199] [util.py:649]               [INFO]     | Plex Popular Collection | = | Space Sweepers                                                       |
[2021-02-24 00:30:13,225] [util.py:649]               [INFO]     | Plex Popular Collection | = | SOMM                                                                 |
[2021-02-24 00:30:13,250] [util.py:649]               [INFO]     | Plex Popular Collection | = | Saint Maud                                                           |
[2021-02-24 00:30:13,274] [util.py:649]               [INFO]     | Plex Popular Collection | + | SOMM: Into the Bottle                                                |
[2021-02-24 00:30:13,398] [util.py:649]               [INFO]     | Plex Popular Collection | = | Betting on Zero                                                      |
[2021-02-24 00:30:13,403] [util.py:649]               [INFO]     | Plex Popular Collection | + | 機會 (기희)                                                              |
[2021-02-24 00:30:13,404] [util.py:594]               [DEBUG]    | Traceback (most recent call last):                                                                 |
                                                                 |   File "/modules/config.py", line 404, in update_libraries
                                                                 |     builder.run_methods(collection_obj, collection_name, map, movie_map, show_map)
                                                                 |   File "/modules/builder.py", line 614, in run_methods
                                                                 |     if len(items) > 0:                                  map = self.library.add_to_collection(collection_obj if collection_obj else collection_name, items, self.filters, self.details["show_filtered"], map, movie_map, show_map)
                                                                 |   File "/modules/plex.py", line 193, in add_to_collection
                                                                 |     else:                                       current.addCollection(name)
                                                                 |   File "/usr/local/lib/python3.9/site-packages/plexapi/base.py", line 477, in addCollection
                                                                 |     self._edit_tags('collection', collections)
                                                                 |   File "/usr/local/lib/python3.9/site-packages/plexapi/base.py", line 465, in _edit_tags
                                                                 |     value = getattr(self, tag + 's')
                                                                 |   File "/usr/local/lib/python3.9/site-packages/plexapi/base.py", line 384, in __getattribute__
                                                                 |     value = super(PlexPartialObject, self).__getattribute__(attr)
                                                                 | AttributeError: 'Track' object has no attribute 'collections'
                                                                 | 
[2021-02-24 00:30:13,406] [config.py:416]             [ERROR]    | Unknown Error: 'Track' object has no attribute 'collections'
@meisnate12
Copy link
Member

this is really odd I've been looking at this one and can't seem to figure out exactly what's going wrong I feel like the issue might be with the plex API wrapper but ill have top do some more digging but I'm looking into it

@meisnate12 meisnate12 self-assigned this Feb 26, 2021
@meisnate12 meisnate12 added the bug Bug is with Plex Meta Manager label Feb 26, 2021
meisnate12 added a commit that referenced this issue Mar 15, 2021
@meisnate12
Copy link
Member

ok i think I've got a fix in if your still receiving this problem. Can you test with the develop branch and let me know?

@bobokun
Copy link
Author

bobokun commented Mar 15, 2021

Thanks! I've tested in develop and it works! I am seeing one error however I'm not sure if it's related or not.

Plex Error: Item 75213 not found I'm not sure if this item is the one from the music library.

today at 5:50 PM  |====================================================================================================|
today at 5:50 PM  |                                      Plex Popular Collection                                       |
today at 5:50 PM  |====================================================================================================|
today at 5:50 PM  |                                                                                                    |
today at 5:50 PM  | Scanning Plex Popular Collection                                                                   |
today at 5:50 PM  |                                                                                                    |
today at 5:50 PM  | Sync Mode: sync                                                                                    |
today at 5:50 PM  |                                                                                                    |
today at 5:50 PM  | Processing Tautulli Most Popular: 20 Movies                                                        |
today at 5:50 PM  | Plex Popular Collection | = | Raya and the Last Dragon                                             |
today at 5:50 PM  | Plex Popular Collection | = | Minari                                                               |
today at 5:50 PM  | Plex Popular Collection | = | Wrong Turn                                                           |
today at 5:50 PM  | Plex Popular Collection | = | Space Sweepers                                                       |
today at 5:50 PM  | Plex Popular Collection | = | SOMM                                                                 |
today at 5:50 PM  | Plex Popular Collection | = | 21 Bridges                                                           |
today at 5:50 PM  | Plex Popular Collection | = | Somm: Into the Bottle                                                |
today at 5:50 PM  | Plex Popular Collection | = | Betting on Zero                                                      |
today at 5:50 PM  | Plex Error: Item 75213 not found                                                                   |
today at 5:50 PM  | Plex Popular Collection | + | Skylines                                                             |
today at 5:50 PM  | Plex Popular Collection | + | The Mauritanian                                                      |
today at 5:50 PM  | Plex Popular Collection | + | Cherry                                                               |
today at 5:50 PM  | Plex Popular Collection | + | Boss Level                                                           |
today at 5:50 PM  | Plex Popular Collection | + | Bambi                                                                |
today at 5:50 PM  | Plex Popular Collection | + | How to Train Your Dragon 2                                           |
today at 5:50 PM  | Plex Popular Collection | + | The Curse of La Llorona                                              |
today at 5:50 PM  | Plex Popular Collection | + | The Trial of the Chicago 7                                           |
today at 5:50 PM  | Plex Popular Collection | + | The Nun                                                              |
today at 5:50 PM  | Plex Popular Collection | + | Judas and the Black Messiah                                          |
today at 5:50 PM  | Plex Popular Collection | + | I Care a Lot                                                         |
today at 5:50 PM  | 20 Movies Processed                                                                                |
today at 5:50 PM  |                                                                                                    |
today at 5:50 PM  | Processing Tautulli Most Watched: 20 Movies                                                        |
today at 5:50 PM  | Plex Popular Collection | = | Raya and the Last Dragon                                             |
today at 5:50 PM  | Plex Popular Collection | = | Wrong Turn                                                           |
today at 5:50 PM  | Plex Popular Collection | = | Minari                                                               |
today at 5:50 PM  | Plex Popular Collection | = | Space Sweepers                                                       |
today at 5:50 PM  | Plex Popular Collection | = | SOMM                                                                 |
today at 5:50 PM  | Plex Popular Collection | = | 21 Bridges                                                           |
today at 5:50 PM  | Plex Popular Collection | = | Somm: Into the Bottle                                                |
today at 5:50 PM  | Plex Popular Collection | = | Betting on Zero                                                      |
today at 5:50 PM  | Plex Error: Item 75213 not found                                                                   |
today at 5:50 PM  | Plex Popular Collection | = | Skylines                                                             |
today at 5:50 PM  | Plex Popular Collection | = | The Mauritanian                                                      |
today at 5:50 PM  | Plex Popular Collection | = | Cherry                                                               |
today at 5:50 PM  | Plex Popular Collection | = | Boss Level                                                           |
today at 5:50 PM  | Plex Popular Collection | = | Bambi                                                                |
today at 5:50 PM  | Plex Popular Collection | = | How to Train Your Dragon 2                                           |
today at 5:50 PM  | Plex Popular Collection | = | The Curse of La Llorona                                              |
today at 5:50 PM  | Plex Popular Collection | = | The Trial of the Chicago 7                                           |
today at 5:50 PM  | Plex Popular Collection | = | The Nun                                                              |
today at 5:50 PM  | Plex Popular Collection | = | Judas and the Black Messiah                                          |
today at 5:50 PM  | Plex Popular Collection | = | I Care a Lot                                                         |
today at 5:50 PM  | 20 Movies Processed                                                                                |
today at 5:50 PM  |                                                                                                    |
today at 5:50 PM  | Plex Popular Collection | - | Saint Maud                                                           |
today at 5:50 PM  | Plex Popular Collection | - | The White Tiger                                                      |
today at 5:50 PM  | 2 Movie Removed                                                                                    |
today at 5:50 PM  |                                                                                                    |
today at 5:50 PM  | Detail: summary updated Collection Summary                                                         |
today at 5:50 PM  | Detail: sort_title updated Collection Sort Title to ++++_1Plex Popular                             |
today at 5:50 PM  | Detail: collection_order updated Collection Order to alpha                                         |
today at 5:50 PM  | Details: have been updated                                                                         |
today at 5:50 PM  | Detail: asset_directory updated collection poster to [File] /config/assets/Plex Popular/poster.png |
today at 5:50 PM  |                                                                                                    |
today at 5:50 PM  | No background to update                                                                            |

@meisnate12
Copy link
Member

All i did was handle the error better so the script doesn't stop working plex doesn't like that rating key for some reason. You can check more about what that key is by going to the URL below replacing http://192.168.1.12:32400 with the URL to your server and <REPLACE-WITH-YOUR-TOKEN> with your token.

view-source:http://192.168.1.12:32400/library/metadata/75213?X-Plex-Token=<REPLACE-WITH-YOUR-TOKEN>

@bobokun
Copy link
Author

bobokun commented Mar 16, 2021

Thanks, I can confirm that error is because it's coming from the music library. At least it doesn't fail like before. I would say this is good enough as a solution


Line wrap
--
  | <?xml version="1.0" encoding="UTF-8"?>
  | <MediaContainer size="1" allowSync="1" identifier="com.plexapp.plugins.library" librarySectionID="9" librarySectionTitle="Music" librarySectionUUID="77f6644e-4f62-4dd9-81c8-542ef9a16b0f" mediaTagPrefix="/system/bundle/media/flags/" mediaTagVersion="1614092584">
  | <Track ratingKey="75213" key="/library/metadata/75213" parentRatingKey="75211" grandparentRatingKey="68895" guid="plex://track/5d07d97f403c640290d3b325" parentGuid="plex://album/5d07c431403c6402909d6a76" grandparentGuid="plex://artist/5d07bc7f403c640290511d11" type="track" title="&#27231;&#26371; (&#44592;&#55148;)" grandparentKey="/library/metadata/68895" parentKey="/library/metadata/75211" librarySectionTitle="Music" librarySectionID="9" librarySectionKey="/library/sections/9" grandparentTitle="&#51076;&#52285;&#51221;" parentTitle="Story of..." originalTitle="&#51076;&#52285;&#51221;" summary="" index="2" parentIndex="1" parentYear="1999" thumb="/library/metadata/75211/thumb/1614282463" parentThumb="/library/metadata/75211/thumb/1614282463" grandparentThumb="/library/metadata/68895/thumb/1612742750" duration="263053" addedAt="1613433348" updatedAt="1615386199">
  | <Media id="105073" duration="263053" bitrate="890" audioChannels="2" audioCodec="alac" container="mp4" optimizedForStreaming="1" has64bitOffsets="0">
  | <Part id="127841" key="/library/parts/127841/1612962957/file.m4a" duration="263053" file="/data/media/Music/Lidarr/Korean/&#51076;&#52285;&#51221;/Story of. (1999)/&#51076;&#52285;&#51221; - Story of. - 02 - &#27231;&#26371; (&#44592;&#55148;).m4a" size="29652044" container="mp4" has64bitOffsets="0" optimizedForStreaming="1">
  | <Stream id="319592" streamType="2" selected="1" default="1" codec="alac" index="0" channels="2" bitrate="890" language="English" languageCode="eng" albumGain="-9.19" albumPeak="0.899994" albumRange="12.694604" audioChannelLayout="stereo" bitDepth="16" gain="-9.19" loudness="-10.21" lra="16.33" peak="0.899994" samplingRate="44100" streamIdentifier="1" displayTitle="ALAC (English Stereo)" extendedDisplayTitle="ALAC (English Stereo)">
  | </Stream>
  | </Part>
  | </Media>
  | </Track>
  | </MediaContainer>


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