digitalec / deemon

Monitor specified artists for new releases
GNU General Public License v3.0
176 stars 15 forks source link

Duplicate column name: explicit – in version 2.4.3 #41

Closed mathiasfoster closed 3 years ago

mathiasfoster commented 3 years ago

As below!

> deemon -V
deemon 2.4.3

> deemon download -u "https://www.deezer.com/en/playlist/6682665064"                                                  ~
Initializing deemon 2.4.3

Traceback (most recent call last):
  File "/home/mathias/.local/bin/deemon", line 8, in <module>
    sys.exit(main())
  File "/home/mathias/.local/lib/python3.8/site-packages/deemon/__main__.py", line 5, in main
    cli.run()
  File "/home/mathias/.local/lib/python3.8/site-packages/click/core.py", line 1137, in __call__
    return self.main(*args, **kwargs)
  File "/home/mathias/.local/lib/python3.8/site-packages/click/core.py", line 1062, in main
    rv = self.invoke(ctx)
  File "/home/mathias/.local/lib/python3.8/site-packages/click/core.py", line 1665, in invoke
    super().invoke(ctx)
  File "/home/mathias/.local/lib/python3.8/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/mathias/.local/lib/python3.8/site-packages/click/core.py", line 763, in invoke
    return __callback(*args, **kwargs)
  File "/home/mathias/.local/lib/python3.8/site-packages/deemon/cli.py", line 62, in run
    db.do_upgrade()
  File "/home/mathias/.local/lib/python3.8/site-packages/deemon/core/db.py", line 268, in do_upgrade
    self.query("ALTER TABLE releases ADD COLUMN explicit INTEGER")
  File "/home/mathias/.local/lib/python3.8/site-packages/deemon/core/db.py", line 276, in query
    return self.cursor.execute(query, values)
sqlite3.OperationalError: duplicate column name: explicit

> nano .config/deemon/logs/deemon.log
2021-10-22 10:47:46 [DEBUG] deemon.cli: deemon 2.4.3
2021-10-22 10:47:46 [DEBUG] deemon.cli: command: "download -u https://www.deezer.com/en/playlist/6682665064"
2021-10-22 10:47:46 [DEBUG] deemon.cli: Python 3.8.10
2021-10-22 10:47:46 [DEBUG] deemon.cli: Linux-5.10.60.1-microsoft-standard-WSL2-x86_64-with-glibc2.29
2021-10-22 10:47:46 [DEBUG] deemon.cli: deemon appdata is located at /home/mathias/.config/deemon
2021-10-22 10:47:46 [DEBUG] deemon.core.config: Loading configuration, please wait...
2021-10-22 10:47:46 [DEBUG] deemon.core.config: Attempting to locate deemix's .arl file
2021-10-22 10:47:46 [DEBUG] deemon.core.config: Successfully loaded ARL
2021-10-22 10:47:46 [DEBUG] deemon.core.db: Database version 3.2
2021-10-22 10:47:46 [DEBUG] deemon.core.db: DATABASE UPGRADE IN PROGRESS!
digitalec commented 3 years ago

This is due to a database bug in a previous release.

You can either restore a backup from v2.1.2 or earlier and run refresh with the time machine option set to the last refresh or downgrade and export artist IDs which you can then import on 2.4.3:

# Downgrade to v2.1.2
pip install --force-reinstall deemon==2.1.2

# Export Artist IDs to CSV
deemon show artists -cHf id -e artists.csv

# Delete database
rm ~/.config/deemon/deemon.db

# Upgrade deemon
pip install --upgrade deemon

# Import artists setting time machine date to last refresh
deemon monitor -I artists.csv -T 2021-10-20

I'll do my best to get a patch out tomorrow for this since it seems to be affecting multiple users.

digitalec commented 3 years ago

Resolved in 2.4.4