gonic icon indicating copy to clipboard operation
gonic copied to clipboard

Empty, duplicate albums

Open djl opened this issue 2 years ago • 6 comments

While browsing some of my collection today, I noticed that gonic was returning some duplicate (and empty) albums for a few artists. Example:

$ sqlite3 gonic.db "select id, left_path, right_path from albums where tag_artist_id=1924"
5799|David Bowie/|1.Outside_ The Nathan Adler Diaries_ A Hyper Cycle
5800|David Bowie/|Aladdin Sane
5801|David Bowie/|Black Tie White Noise
5802|David Bowie/|Brilliant Adventure [1992?2001]
5803|David Bowie/|Changesbowie
5804|David Bowie/|David Bowie
5805|David Bowie/|Diamond Dogs
5806|David Bowie/|Earthling
5807|David Bowie/|Heathen
5808|David Bowie/|Hunky Dory
5809|David Bowie/|I?m Only Dancing (The Soul Tour 74)
5810|David Bowie/|Let?s Dance
5811||Lodger
5812||Low
5813|David Bowie/|Never Let Me Down
5814|David Bowie/|Reality
5815|David Bowie/|Scary Monsters? and Super Creeps
5816|David Bowie/|Space Oddity
5817|David Bowie/|Station to Station
5818|David Bowie/|The Man Who Sold the World
5819|David Bowie/|The Next Day
5820|David Bowie/|The Rise and Fall of Ziggy Stardust and the Spiders From Mars
5821|David Bowie/|The Width of a Circle
5822|David Bowie/|Tonight
5823|David Bowie/|Toy
5824|David Bowie/|Young Americans
5825|David Bowie/|?hours??
5826|David Bowie/|?Heroes?
5827|David Bowie/|?
27022|David Bowie/|Lodger
27023|David Bowie/|Low

In the above query there are two rows with an empty left_path. If we query for tracks belonging to these albums, we get an empty result:

$ sqlite3 gonic.db "select * from tracks where album_id=5811 or album_id=5812"
$

There appears to be lots of albums like this in my collection now.

$ sqlite3 data/gonic.db "select count(*) from albums where left_path=''"
9905

To fix, I just dropped the rows where left_path='' but I'm curious about how this happened. Any ideas?

djl avatar Jul 11 '22 17:07 djl

howdy, what version of gonic are you using? and is it from source or dockerhub

sentriz avatar Jul 20 '22 22:07 sentriz

Oops. Not sure how I missed that info :/

This happens on both 0.14.0 and in the nightly builds (both from Docker Hub).

I noticed the problem a couple of weeks ago so I started from scratch with a nightly build hoping it would fix the issue. It did not.

djl avatar Jul 21 '22 14:07 djl

okay thanks :+1:

so just to be clear, it was a nightly build from a few weeks ago, fresh database, did a scan, and you were left with album records with left_path='' and tag_artist_id is not null ?

note that left_path='' is normal, it represents top level folders in your library. in my case for example, its artist folders right under the root. but it is strange if they also have a tag_artist_id

image

sentriz avatar Jul 21 '22 14:07 sentriz

so just to be clear, it was a nightly build from a few weeks ago, fresh database, did a scan, and you were left with album records with left_path='' and tag_artist_id is not null ?

I don't recall if they appeared immediately after the first scan or if it was a subsequent scan. I've kicked off another fresh scan. When it's done (in about ~2 hours) I'll see if the dupes appear immediately.

note that left_path='' is normal, it represents top level folders in your library. in my case for example, its artist folders right under the root. but it is strange if they also have a tag_artist_id

That makes sense.

If I check my current database, I have 107 albums without left_path but with tag_artist_id

$ sqlite3 gonic.db "select count(*) from albums where left_path='' and tag_artist_id is not null"
107

djl avatar Jul 21 '22 14:07 djl

Back with a fresh scan and with another 107 albums:

$ sqlite3 gonic.db "select count(*) from albums where left_path='' and tag_artist_id is not null"
107

These seem to be the exact same albums as before so I'm guessing it's a weird metadata or tag issue.

I'll find some time this weekend to have a closer look.

djl avatar Jul 22 '22 13:07 djl

Oh lord, I figured out why it was those 107 albums over and over again.

All of those albums have titles which match other artist names elsewhere in my collection.

Examples:

# I have albums by artists called "Lodger" and "Low"
$ sqlite3 gonic.db "select r.name, a.left_path, a.right_path, r.id, a.id from albums a, artists r where a.left_path='' and a.tag_artist_id is not null and r.id=a.tag_artist_id" | grep Bowie
David Bowie||Lodger|2066|6277
David Bowie||Low|2066|6278

And the one that made me realise it:

# Obscura is a Gorguts album but also the name of another band
$ sqlite3 gonic.db "select * from albums where tag_artist_id=3379" | grep Obscura
10086|2021-09-16 22:40:36.1588874+00:00|2022-07-24 19:30:06.664163509+00:00|2021-09-16 22:40:36.1588874+00:00||Obscura||1|/media/music||3379|Obscura||8ce52599-4faa-438e-bc7b-6a0a23a67596|1998
29341|2021-09-16 22:40:36.1588874+00:00|2022-07-24 22:19:27.920269586+00:00|2021-09-16 22:40:36.1588874+00:00|Gorguts/|Obscura||10082|/media/music|cover.jpg|3379|Obscura||8ce52599-4faa-438e-bc7b-6a0a23a67596|1998

djl avatar Jul 24 '22 22:07 djl

hi, i tried to reproduce this today with a structure like

/music
/music/TheSame
/music/TheSame/Album
/music/TheSame/Album/track-1.flac
/music/TheSame/Album/track-2.flac
/music/ArtistTwo
/music/ArtistTwo/TheSame
/music/ArtistTwo/TheSame/track-1.flac
/music/ArtistTwo/TheSame/track-2.flac

but wasn't able to reproduce it

would you mind emailing me maybe some kind of zipped up structure that has an artist that has album X and an artist X?

thanks!

sentriz avatar Sep 09 '22 10:09 sentriz

nevermind, i can reproduce it! weird. having a look

sentriz avatar Sep 09 '22 10:09 sentriz

that was a good one. an issue with the ORM gonic uses

thanks for opening this issue :+1: should be fixed now

image

sentriz avatar Sep 09 '22 12:09 sentriz