manolomartinez / greg

A command-line podcast aggregator
GNU General Public License v3.0
296 stars 37 forks source link

Init tag structure if not exists #107

Closed sabberworm closed 3 years ago

sabberworm commented 3 years ago

I had some Podcasts that would print

Traceback (most recent call last):
  File "bin/greg", line 33, in <module>
    sys.exit(load_entry_point('Greg', 'console_scripts', 'greg')())
  File "src/greg/greg/parser.py", line 138, in main
    function(vars(args))
  File "src/greg/greg/commands.py", line 252, in download
    feed.download_entry(entry)
  File "src/greg/greg/classes.py", line 336, in download_entry
    aux.tag(placeholders)
  File "src/greg/greg/aux_functions.py", line 212, in tag
    setattr(file_to_tag.tag, mytag, tagdict[mytag])
AttributeError: 'NoneType' object has no attribute 'artist'

when trying to tag them. It’s because they didn’t have any ID3 tags to begin with.

manolomartinez commented 3 years ago

Right, of course. Thanks for this.