Albums with tracks having identical titles

Having trouble installing AmpJuke ?
Check this.

Albums with tracks having identical titles

Postby Wurlitzer on 22-03-2010 04:16

Hi,

I have a few albums containing some tracks with the same name. When scanning those albums, the tracks that have duplicate names are omitted, somehow, and not stored in the database.

Can someone reproduce this?
Wurlitzer
Hangaround
Hangaround
 
Posts: 12
Joined: 18-10-2009 18:14
Location: Denmark

Re: Albums with tracks having identical titles

Postby Michael on 23-03-2010 21:28

Hi Wurlitzer,

Reproduce and reproduce...
...not exactly, but by looking at the sourcecode I can see that a check is made against a given track to see if the track's name, artist/performer name and album name already exists in the database.
If it does, the track will not be stored in the database.

Sidenote: Frankly, I'm a bit puzzled...What albums could possibly have 100% identical tracks in relation to the name of the performer/artist as well as the track name..? Please, enlighten me in this matter :)

Anyway, to avoid a check completely, when a track has name, artist/performer name (and obviously an album name as well) present, open "scan2.php" and comment out line 685 (assuming you run AmpJuke 0.8.2) so it says:
Code: Select all
// $is_music=0;


The complete, modified block of code (around line 685) will read:
Code: Select all
            if (($is_music==1) && ($track['album']<>'')) {
               $title_exists=find_keys($track['performer'],$track['album'],$track['title'],$details);
               if ($title_exists==1) {
                  // $is_music=0;
               }   
            }


I haven't tried this in real life...
...but in theory (at least), a check to see if a given track is already on an album will be omitted.

Hope this makes sense. If not, please update the thread (well...feel free to do so in any case).

//Michael.

P.S. It's still a great nickname you've got :wink:
User avatar
Michael
Site Admin
Site Admin
 
Posts: 449
Joined: 03-07-2007 13:46
Location: Denmark

Re: Albums with tracks having identical titles

Postby Wurlitzer on 24-03-2010 03:29

Hi Michael,

Yeah, I agree that it's a bit of weird thing :? Most of the albums featuring this oddity are quite obscure, I have noticed, though. I don't know how many duplicate track titles there are in my collection, but I've stumbled upon some.
Here is an example: http://www.discogs.com/Young-Marble-Gia ... ster/41768
On CD2 of this album, the track "Radio Silents" is featured two times, although they are different recordings. the "phenomenon" might be common in such bonus CDs, which contains extra non previously released recordings.

The workaround you have proposed, almost works. The scan report shows that it went through all tracks this time, without omitting duplicates, but they (the duplicates) didn't get added to the database. Why is that?

I have uploaded a fake album with empty mp3s for testing, if you want to have a look at it:
http://www.box.net/shared/oahc122lax

Thanks for the help again! :wink:
Wurlitzer
Hangaround
Hangaround
 
Posts: 12
Joined: 18-10-2009 18:14
Location: Denmark

Re: Albums with tracks having identical titles

Postby Wurlitzer on 25-03-2010 03:40

Michael,

I realise you may have intended this as a feature. If so, what was the reason to check for duplicates?
Making such a music scanning script must be really tricky, as there seem to be many rules and exceptions to take care of. It's a fine balance between efficiency of the script and its features, and the way a music collection is tagged :wink:
Wurlitzer
Hangaround
Hangaround
 
Posts: 12
Joined: 18-10-2009 18:14
Location: Denmark

Re: Albums with tracks having identical titles

Postby Michael on 25-03-2010 08:47

Hi Wurlitzer,

Well...since AmpJuke was made to run completely independent in relation to folder structure, filenames etc. I assume a basic check to see if a track is already present in the database would be a good idea..

The "keys" to find out if a track is present in the music collection already relies on comparing the track's tags against the database.
This is done using the track's name (of song), artist/performer name and (optionally) album name.

If a check isn't made - and no "Only scan+import tracks added after..." date is used - during scan+import, a track would be considered new each and every time scan+import runs...
...f.ex., if you scan+import 2k tracks and later decides to run scan+import again, you would end up with 4k tracks.

//Michael.
User avatar
Michael
Site Admin
Site Admin
 
Posts: 449
Joined: 03-07-2007 13:46
Location: Denmark

Re: Albums with tracks having identical titles

Postby Wurlitzer on 25-03-2010 21:07

Oh OK, yeah that makes sense :lol:
So, solving this problem would certainly not be to omit duplicate checks. But the find_keys() function could be refined, to check not only for artist, album, and track name, but also track number.

I'll report back on how that goes.
Wurlitzer
Hangaround
Hangaround
 
Posts: 12
Joined: 18-10-2009 18:14
Location: Denmark

Re: Albums with tracks having identical titles

Postby Wurlitzer on 26-03-2010 02:19

Using the suggestion I made in my previous post, I did the following:

In the find_keys() function, add an argument, like so:
Code: Select all
function find_keys($artist,$album,$trk_name,$trk_no,$details)


In the same function, modify line 337 that reads
Code: Select all
$qry.='performer_id='.$art_id.' AND album_id='.$alb_id.' AND name="'.$trk_name.'"';

So that is says:
Code: Select all
$qry.='performer_id='.$art_id.' AND album_id='.$alb_id.' AND name="'.$trk_name.'" AND track_no='.$trk_no;


At line 751, the line that reads
Code: Select all
$qry.=' AND name="'.$track['title'].'"';

Is modified like so:
Code: Select all
$qry.=' AND name="'.$track['title'].'" AND track_no='.$track['track_number'];


That's it!
scan2.php now checks for already existing music on the whole database, but if tracks have identical names (with different track numbers) within an album, they will be seen as unique.

What do you think Michael? should be an improvement, no?
Wurlitzer
Hangaround
Hangaround
 
Posts: 12
Joined: 18-10-2009 18:14
Location: Denmark

Re: Albums with tracks having identical titles

Postby Michael on 26-03-2010 09:22

I think you've made a really great improvement :!:
...and you've also done a great job documenting what's changed.

The only thing I can think of that needs to be done is an option when setting up scan+import that says something like "Ignore track number when identifying identical tracks"...
...or something like that. So - if checked - your improvement will not be taken into account.
Never mind - I'll thinks of it and come up with something for the next release (0.8.3).

Thanks again. It's a really great enhancement.

//Michael.

P.S. Do you have a homepage I can link to when releasing this in the frontpage-news related to 0.8.3 ?
User avatar
Michael
Site Admin
Site Admin
 
Posts: 449
Joined: 03-07-2007 13:46
Location: Denmark

Re: Albums with tracks having identical titles

Postby Wurlitzer on 26-03-2010 16:05

Glad you like it! Unfortunately I don't have any website to promote...
Wurlitzer
Hangaround
Hangaround
 
Posts: 12
Joined: 18-10-2009 18:14
Location: Denmark


Return to Installation / support

Who is online

Users browsing this forum: No registered users and 1 guest

cron