Skip to content

Commit

Permalink
Add fallback to parser context for album id. Fix PLUGIN_NAME typo.
Browse files Browse the repository at this point in the history
  • Loading branch information
rdswift committed Apr 25, 2022
1 parent d187eba commit ec3d93a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions plugins/persistent_variables/persistent_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.

PLUGIN_NAME = 'Persistent Variabless'
PLUGIN_NAME = 'Persistent Variables'
PLUGIN_AUTHOR = 'Bob Swift (rdswift)'
PLUGIN_DESCRIPTION = '''
<p>
Expand Down Expand Up @@ -111,9 +111,13 @@ def get_session_var(cls, key):

def _get_album_id(parser):
file = parser.file
if file and file.parent and hasattr(file.parent, 'album') and file.parent.album:
return str(file.parent.album.id)
return ""
if file:
if file.parent and hasattr(file.parent, 'album') and file.parent.album:
return str(file.parent.album.id)
else:
return ""
# Fall back to parser context to allow processing on albums newly retrieved from MusicBrainz
return parser.context['musicbrainz_albumid']


def func_set_s(parser, name, value):
Expand Down

0 comments on commit ec3d93a

Please sign in to comment.