8000 [FR] Per-track history logging regardless of download type · Issue #155 · Xoconoch/spotizerr · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[FR] Per-track history logging regardless of download type #155

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
TheHYPO35 opened this issue Jun 4, 2025 · 15 comments
Closed

[FR] Per-track history logging regardless of download type #155

TheHYPO35 opened this issue Jun 4, 2025 · 15 comments

Comments

@TheHYPO35
Copy link

Downloading seems to be working fine, but nothing is logging to history:

I get log entries like:

2025-06-04 17:31:51 [MainProcess:Thread-3 (_process_output_reader)] [routes.utils.celery_manager] [INFO] - Celery[STDERR]: 2025-06-04 17:31:51,161 - routes.utils.celery_tasks - INFO - Task bb84e3f0-b66a-451e-8469-1f31d64972a9 completed successfully: Unknown

2025-06-04 17:31:51 [MainProcess:Thread-3 (_process_output_reader)] [routes.utils.celery_manager] [WARNING] - Celery[STDERR]: 2025-06-04 17:31:51,163 - routes.utils.celery_tasks - WARNING - History: No task_info found for task_id bb84e3f0-b66a-451e-8469-1f31d64972a9. Cannot log to history.

Any suggestions?

@nickgnat
Copy link
nickgnat commented Jun 4, 2025

I noticed this as well after updating from 2.1.1 to 2.2.1. The history entries that were generated by 2.1.1 still display, but nothing is added even though downloads are working successfully. I'm seeing the same sorts of log entries as well:

2025-06-04 18:25:01 [MainProcess:Thread-7 (_process_output_reader)] [routes.utils.celery_manager] [INFO] - Celery[STDERR]: 2025-06-04 18:25:01,235 - routes.utils.celery_tasks - INFO - Task bc820db7-4502-4368-a95b-e8b892004077 completed successfully: Unknown
2025-06-04 18:25:01 [MainProcess:Thread-7 (_process_output_reader)] [routes.utils.celery_manager] [WARNING] - Celery[STDERR]: 2025-06-04 18:25:01,236 - routes.utils.celery_tasks - WARNING - History: No task_info found for task_id bc820db7-4502-4368-a95b-e8b892004077. Cannot log to history.

@TheHYPO35
Copy link
Author

So maybe something broke in that version? I have only just installed it for the first time, so I have no experience with the prior version.

@nickgnat
Copy link
nickgnat commented Jun 4, 2025

Here's possibly some more relevant log output for this bug -- this might be a different issue resulting in my history carrying over from a previous version -- @TheHYPO35 do you see log entries like these?

2025-06-04 18:35:16 [MainProcess:Thread-7 (_process_output_reader)] [routes.utils.celery_manager] [ERROR] - Celery[STDERR]: 2025-06-04 18:35:16,662 - routes.utils.history_manager - ERROR - Error adding entry to download history for task_id 670161c7-8e7c-48e9-a2e0-9c8a6dc46a0d: table download_history has no column named service_used
2025-06-04 18:35:16 [MainProcess:Thread-7 (_process_output_reader)] [routes.utils.celery_manager] [INFO] - Celery[STDERR]: Traceback (most recent call last):
2025-06-04 18:35:16 [MainProcess:Thread-7 (_process_output_reader)] [routes.utils.celery_manager] [INFO] - Celery[STDERR]: File "/app/routes/utils/history_manager.py", line 69, in add_entry_to_history
2025-06-04 18:35:16 [MainProcess:Thread-7 (_process_output_reader)] [routes.utils.celery_manager] [INFO] - Celery[STDERR]: cursor.execute("""
2025-06-04 18:35:16 [MainProcess:Thread-7 (_process_output_reader)] [routes.utils.celery_manager] [INFO] - Celery[STDERR]: sqlite3.OperationalError: table download_history has no column named service_used

@Xoconoch
Copy link
Owner
Xoconoch commented Jun 4, 2025

this might be a different issue resulting in my history carrying over from a previous version

In your case, that is correct, @nickgnat. I forgot to add a column-check on the db, sorry! Quickest way to solve this is to just delete the previous history db and restart the container so a new db is created with the correct columns. Or, if you really care about your previous history, wait for 2.2.2

@Xoconoch Xoconoch closed this as completed Jun 4, 2025
@Xoconoch Xoconoch reopened this Jun 4, 2025
@Xoconoch
Copy link
Owner
Xoconoch commented Jun 4, 2025

@TheHYPO35 please share the specific link (or list of links) that are not added to the history

@TheHYPO35
Copy link
Author

I am currently downloading a list that is on my personal account and I'm hesitant to link it here, but when that's done, I'll test it with something public and link here if it doesn't work. So far nothing has added to history.

@Xoconoch
Copy link
Owner
Xoconoch commented Jun 4, 2025

So, if I understand correctly, this download you mention is the only one you've ever performed in your Spotizerr instance?

If that is the case, then it not showing up in the history is normal, since it hasn't finished yet.

@TheHYPO35
Copy link
Author
TheHYPO35 commented Jun 5, 2025

No, that's not what I'm saying. I haven't done very many, but I tried a few downloads (mainly longer playlists), and some have completed successfully, but do not log to history. However, I think I may now have sorted out why. I've just tried a few more downloads and figured out a bit more.

When I responded to nickgnat above, I didn't realize the 2.2 versions had only just come out today, so although I only installed spotizerr a couple of days ago and started using it today, there would have been an automatic update in there.

Digging a bit further, single tracks (which I had only done one or two of) are failing to write history with the similar error nickgnat reported above:

2025-06-04 23:38:21 [MainProcess:Thread-7 (_process_output_reader)] [routes.utils.celery_manager] [ERROR] - Celery[STDERR]: 2025-06-04 23:38:21,383 - routes.utils.history_manager - ERROR - Error adding entry to download history for task_id 3f19b874-72c0-4df3-b17a-6276b7cf0aba: table download_history has no column named service_used

I tested the solution you recommended (deleted the download_history.db file, restarted redis and spotizerr) and it worked for the single track.

The logs were throwing me a bit because there are still plenty of instances of "No task_info found for task_id da53ab2c-ad03-44e6-b322-fda189e86e9e. Cannot log to history."

However, what I'm now realizing is that this error show up for every other kind of task the app runs, including, for example, cleanup_stale_errors that runs every minute, among others.

I believe overlapping completions of songs in the playlists with "can not log to history" from those random tasks led me to believe that the song downloads (from the playlist) were not being logged as they should, when in fact, they are only logged once the whole playlist is downloaded (at which point I was getting the column-based error before the fix)

I also see now that the history records the playlist as a single entry rather than each song. Is it possible to log (to history) at least playlists as individual songs? Playlists can change over time, meaning that even with the link to the playlist in the info, the playlist may not still be what was downloaded. It would also address cancelled or failed playlist downloads or the app crashing by showing which songs were successful and which were not (though I haven't had a failed playlist since the history has been working, so maybe it shows that somewhere?)

Thanks for your patience. Sorry for the confusion.

Side note: for what it's worth, my history shows "Quality" as "NONE Nonek (FLAC)" - I don't have Deezer, but my Deezer setting is FLAC. This is Spotify downloading with an OGG320 bitrate.

@Xoconoch Xoconoch changed the title History not logging [FR] Per-track history logging regardless of download type Jun 5, 2025
@Xoconoch
Copy link
Owner
Xoconoch commented Jun 5, 2025

However, what I'm now realizing is that this error show up for every other kind of task the app runs

Yes, I am aware of this bug but I've been kinda lazy to find the root cause. Your confusion is understandable since it is misleading.

Regarding the per-track recording for playlists: it should be totally possible, however, it would require modifying the structure of how the deezspot library works, since it was not made with a download history in mind.

I will leave this issue opened as a feature requeest for that

@nickgnat
Copy link
nickgnat commented Jun 5, 2025

this might be a different issue resulting in my history carrying over from a previous version

In your case, that is correct, @nickgnat. I forgot to add a column-check on the db, sorry! Quickest way to solve this is to just delete the previous history db and restart the container so a new db is created with the correct columns. Or, if you really care about your previous history, wait for 2.2.2

Ok, I deleted the old db and new downloads are showing in the Download History, however, the "Quality" for 320kbps mp3s from Deezer lists as NONE Nonek (MP3_320). Not sure if this is just a weird parse or what. Also "Service" lists my username for Deezer, which is fine, but I think I'd prefer $USERNAME (Deezer) or something. Other than that, appears to be working fine.

@Xoconoch
Copy link
Owner
Xoconoch commented Jun 5, 2025

The Nonek is indeed because of parsing shenanigans, I am trying to make quality show both selected quality on the service and converted quality, but I think the logic of it was not well made, will look into it.

Xoconoch added a commit that referenced this issue Jun 10, 2025
@Xoconoch
Copy link
Owner

FIxed and implemented in 2.5.0

@TheHYPO35
Copy link
Author

For what it's worth, it no longer says "Nonek" (v2.5 now), but it still shows quality as "FLAC" (and service as N/A) even though I don't have Deezer, so flac is not the quality or even a possible quality for me.

Also, since we're discussing logs (let me know if I this is worth opening a separate issue for), in the "Info" circle link in the History section, it lists some good details including the URL and spotify ID for the download. This would be especially useful for failed downloads so you can find the URL again and retry them - except (at least in Windows Chrome), the "info" popup is some sort of notification popup which does not allow text selection or copying, so you'd have to manually type out the long URL to make use of it. If there's any way to make this a popup that can be selected or copied from, that would be great. A "retry" link in the history next to failed downloads wouldn't be a bad feature either. Neither is critical, but a 'would be nice'. The "hide individual tracks" checkbox at the top doesn't do anything for me either, assuming it's supposed to hide and entries with the "type" of "track". It doesn't for me.

@Xoconoch
Copy link
Owner

I didn't know that it wasn't possible to copy from it in chrome

Please open a new issue

@TheHYPO35
Copy link
Author

Will do. And just a thanks - I just saw a playlist from last night complete and noticed that the individual songs are listed - that's wonderful, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
0