When a key is missing from info.json, it shouldn't prevent the rest of
the data from being loaded.
When adding an item that wasn't a part of a playlist, there will be no
'playlist_title'. Before this change, all the metadata would be missing
from these videos. Now, the other data gets loaded. Yay!
I tried to replecate the pattern already established of using:
if data['key']:
but this raised the same KeyError when the key didn't exist. I'm not a
regular Python dev but I think something changed in Python 3. Using the
in syntax here seems to work great for all the places I changed.
When a key is missing from info.json, it shouldn't prevent the rest of the data from being loaded.
When adding an item that wasn't a part of a playlist, there will be no 'playlist_title'. Before this change, all the metadata would be missing from these videos. Now, the other data gets loaded. Yay!
I tried to replecate the pattern already established of using:
but this raised the same KeyError when the key didn't exist. I'm not a regular Python dev but I think something changed in Python 3. Using the
in
syntax here seems to work great for all the places I changed.I think this should address:
https://github.com/JordyAlkema/Youtube-DL-Agent.bundle/issues/6#issuecomment-912676366 https://github.com/JordyAlkema/Youtube-DL-Agent.bundle/issues/10#issuecomment-961840829 https://github.com/JordyAlkema/Youtube-DL-Agent.bundle/issues/12
As the issue they describe has the same symptoms that I was experiencing.