terrelsa13 / MUMC

Multi-User Media Cleaner aka MUMC (pronounced Mew-Mick) will go through movies, tv episodes, audio tracks, and audiobooks in your Emby/Jellyfin libraries deleting media items you no longer want.
GNU General Public License v3.0
92 stars 6 forks source link

UnboundLocalError: cannot access local variable 'tvstudionetwork_item_info' where it is not associated with a value #85

Closed twicehopped closed 11 months ago

twicehopped commented 1 year ago

Running into this issue when scanning my entire library:

Traceback (most recent call last): File "C:\Users*\MUMC\MUMC\mumc.py", line 8591, in episode_dict,episode_found=get_media_items('episode',config_dict,episode_dict,user_key) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users*\MUMC\MUMC\mumc.py", line 5936, in get_media_items item_isBlackTagged=get_isEPISODE_Tagged(item,user_key,blacktags) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users***\MUMC\MUMC\mumc.py", line 3196, in get_isEPISODE_Tagged istag_EPISODE['seriesstudionetwork'][tvstudionetwork_item_info['Id']],tagged_items=get_isItemTagged(usertags,tagged_items,tvstudionetwork_item_info) ^^^^^^^^^^^^^^^^^^^^^^^^^ UnboundLocalError: cannot access local variable 'tvstudionetwork_item_info' where it is not associated with a value

Config attached with keys removed. mumc_config - Copy.txt

terrelsa13 commented 1 year ago

Was using a variable before it was assigned a value. Should be fixed in the latest. v4.1.23

twicehopped commented 1 year ago

Thanks! Is 4.1.23 published?

terrelsa13 commented 1 year ago

It is on the MUMC_Latest branch.

And is now the latest release as well.

twicehopped commented 1 year ago

Using 4.1.24 and ran into this issue (I think in a different line of code):

Traceback (most recent call last): File "C:\Users*\MUMC\MUMC\mumc.py", line 8597, in episode_dict,episode_found=get_media_items('episode',config_dict,episode_dict,user_key) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users*\MUMC\MUMC\mumc.py", line 5942, in get_media_items item_isBlackTagged=get_isEPISODE_Tagged(item,user_key,blacktags) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users*\MUMC\MUMC\mumc.py", line 3199, in get_isEPISODE_Tagged if (tvstudionetwork_item_info): ^^^^^^^^^^^^^^^^^^^^^^^^^ UnboundLocalError: cannot access local variable 'tvstudionetwork_item_info' where it is not associated with a value

wangrui1573 commented 11 months ago

:[KEEPING] - Episode - 机动战士高达:水星的魔女 - s01.e10 - 旋绕于心的想法 - MBS - Played 270 days ago - Play Count: 1 - Created 105 days ago - Favorite: False - WhiteTag: False - BlackTag: False - Whitelisted: False - Blacklisted: False - EpisodeID: 41147 Traceback (most recent call last): File "mumc.py", line 8597, in episode_dict,episode_found=get_media_items('episode',config_dict,episode_dict,user_key) File "mumc.py", line 5922, in get_media_items item_isWhiteTagged=get_isEPISODE_Tagged(item,user_key,whitetags) File "mumc.py", line 3199, in get_isEPISODE_Tagged if (tvstudionetwork_item_info): UnboundLocalError: local variable 'tvstudionetwork_item_info' referenced before assignment

same problem with last MUMC v4.1.24

terrelsa13 commented 11 months ago

@wangrui1573 @twicehopped My apologies, life and work has been busy. I have not had a lot of time to spend on v4 of this script. And anytime I do have, I use it toward making improvement in v5 of the script.

I have fixed all places in the tagged and favorited functions where the variable was used before it was defined in v5. v5 is not ready for the latest branch, but it is mostly functional and available in the beta branch.