Polochon-street / blissify-rs

bliss bindings for MPD.
30 stars 6 forks source link

Feature request: logging #73

Open iconoclasthero opened 1 month ago

iconoclasthero commented 1 month ago

ok, if i'm going to spend the time and energy to have something scan 67798 songs and it is going to report if there are errors with scanning those files, I want to be able to go back and find out why there were problems.

I tried to do blissify --config-path /library/music/.share/bliss-rs/config.json init /library/music &>>/var/log/mpd/blissify.log which should log it to file, but that seems to be a kludge at best.

Additionally, I'm at a loss to understand why there are 9211 lines telling me that there's a problem with the same exact song!

$ grep '/library/music/99-reggae/Peter Tosh/Peter Tosh & Bob Marley -- Wisdom (1998) (mp3)/02-01 - Bob Marley & The Wailers -- More Axe.m4a' /var/log/mpd/blissify.log |wc -l
9211

or even 17000:

$ grep "/library/music/Bob Marley/Bob Marley & The Wailers -- Talkin' Blues (1991) (mp3)/Bob Marley & The Wailers -- 01-04 - Burnin' & Lootin'.m4a" blissify.log|wc -l
17000
iconoclasthero commented 1 month ago

I noticed that the songs with errors are recorded... ...failed: error happened while analyzing file – empty or too short song. The error has been stored.

Realistically, that is most of what I want out of the log. Is there a facility to output these aside from directly quering the db, e.g.,

$ sqlite3 /library/music/.share/bliss-rs/songs.db "SELECT * FROM song WHERE error IS NOT NULL;"
503|/library/music/99-reggae/Peter Tosh/Peter Tosh & Bob Marley -- Wisdom (1998) (mp3)/02-08 - Bob Marley & The Wailers -- Lively Up Yourself.m4a|||||||||||2024-09-19 16:44:06||0||error happened while analyzing file – empty or too short song.
593|/library/music/Bob Marley/Bob Marley & The Wailers -- Talkin' Blues (1991) (mp3)/Bob Marley & The Wailers -- 01-04 - Burnin' & Lootin'.m4a|||||||||||2024-09-19 16:44:59||0||error happened while analyzing file – empty or too short song.
1563|/library/music/99-reggae/Peter Tosh/Peter Tosh & Bob Marley -- Wisdom (1998) (mp3)/02-02 - Peter Tosh & The Wailers -- 400 Years.m4a|||||||||||2024-09-19 17:02:59||0||error happened while analyzing file – empty or too short song.
1604|/library/music/Bob Marley/Bob Marley & The Wailers -- Talkin' Blues (1991) (mp3)/Bob Marley & The Wailers -- 01-12 - Talkin'.m4a.mp4|||||||||||2024-09-19 17:03:14||0||error happened while analyzing file – empty or too short song.
2435|/library/music/Alabama 3/Alabama 3 -- The Last Train to Mashville, Volume 1 (2004) (m4a) (mp3)/Alabama 3 -- 01-06 - R.E.H.A.B..m4a|||||||||||2024-09-19 17:14:05||0||error happened while analyzing file – empty or too short song.
3336|/library/music/Bob Marley/Bob Marley & The Wailers -- Talkin' Blues (1991) (mp3)/Bob Marley & The Wailers -- 01-07 - Get Up Stand Up.m4a|||||||||||2024-09-19 17:20:56||0||error happened while analyzing file – empty or too short song.
3653|/library/music/Bob Marley/Bob Marley & The Wailers -- Talkin' Blues (1991) (mp3)/Bob Marley & The Wailers -- 01-08 - Talkin'.m4a|||||||||||2024-09-19 17:23:23||0||error happened while decoding file – while opening format for file '/library/music/Bob Marley/Bob Marley & The Wailers -- Talkin' Blues (1991) (mp3)/Bob Marley & The Wailers -- 01-08 - Talkin'.m4a': ffmpeg::Error(2: No such file or directory).
4329|/library/music/97-afrobeat/Tony Allen/Tony Allen -- Live (2004) (mp3)/Tony Allen -- 01-06 - Kindness.mp3|||||||||||2024-09-19 17:34:58||0||error happened while decoding file – No audio stream found for file '/library/music/97-afrobeat/Tony Allen/Tony Allen -- Live (2004) (mp3)/Tony Allen -- 01-06 - Kindness.mp3'.

maybe a blissify --list_errors ?

Polochon-street commented 1 month ago

Hi! Thanks for submitting, and very good point, you should be able to see errors without having to fiddle with the SQL.

I've made a branch at https://github.com/Polochon-street/blissify-rs/pull/76 - list-errors. Could you check it out and tell me if this works for you? I'm usually looking directly at the SQL log so the output of this might be a bit crude, tell me if you think some information should be added, or if the formatting needs some improvements.

As a side-note, would it be possible to send me the failing files? Especially interested in the ones that make blissify segfault, as this should not happen, and I'm hoping I can fix this, but I'd be also interested in looking at the others and see what's up there too.

Cheers!