Bug 322185 - Amarok guesses album from file path for tracks without album-tag at import
Summary: Amarok guesses album from file path for tracks without album-tag at import
Alias: None
Product: amarok
Classification: Unclassified
Component: Collections/Local (show other bugs)
Version: 2.7-git
Platform: Ubuntu Packages Linux
: NOR normal with 15 votes (vote)
Target Milestone: 2.8
Assignee: Amarok Developers
Depends on:
Reported: 2013-07-10 09:33 UTC by Mathias Dietrich
Modified: 2013-07-22 07:39 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Note You need to log in before you can comment on or make changes to this bug.
Description Mathias Dietrich 2013-07-10 09:33:06 UTC
Amarok guesses an album from the track's filepath if a track has no album-tag

Reproducible: Always

Steps to Reproduce:
1. Have files assorted in folders with year and without album tag
2. Add a new collection to amarok
3. Look at the local collection, e.g. with First-Level Album
Actual Results:  
Amarok adds the last folder from the filepath as Album for the track in it's collection

Expected Results:  
Amarok should leave the Album blank in it's collection

This does not happen in Amarok 2.7 and must be introduced later.


Here are typical examples where Amarok guesses the album at import although it was never asked to:

/home/user/Musik/FLAC/Pop/1970/ -> All files within this folder get "1970" as album
/home/user/Musik/Acoustic/ -> All files get "Acoustic" as album
/home/user/Musik/Oldies/60s/ -> All files get "60s" as album
Comment 1 Myriam Schweingruber 2013-07-10 09:41:19 UTC
Just to be 100% sure: you did check that there were indeed no Album tags with another tool? Did you try reproducing this, e.g remove the Album tag with kid3 since you don't want it, then reopening Amarok and check there was indeed a tag written?

FWIW: I can't reproduce this here at all, using Amarok v2.7.90-23-g2180541
Comment 2 Myriam Schweingruber 2013-07-10 10:13:19 UTC
I tried again, and there is a display of an album tag, but the tag is not actually written. Doing a full collection rescan shows the tags correctly, so this is the "good old caching bug" raising its head again *sigh*
Comment 3 shaddowy2 2013-07-14 13:43:38 UTC
Yes, that was what I saw when I tried Amarok-Git, but I couldn't describe the problem properly on #irc :)
Comment 4 Myriam Schweingruber 2013-07-14 13:59:05 UTC
Not a regression, just an old tenacious bug that is very hard to solve.
Comment 5 Myriam Schweingruber 2013-07-14 14:04:50 UTC
related to bug 262504
Comment 6 Matěj Laitl 2013-07-21 15:12:24 UTC
This is not a bug, but a feature, since:
commit 2c45d97ad5083dd78675da9357e73241f4a28261
Author: Ralf Engels <ralf.engels@nokia.com>
Date:   Fri Nov 26 18:55:17 2010 +0100

    Fix CollectionScanner identify compilation problems

To quote the part of the code:
        // use the directory name as album name
        QString fallbackAlbumName = ( dirAlbumNames.isEmpty() ?
                                      QDir( dir->path() ).dirName() :
                                      QString() );

...so almost 3 years old. The behaviour is not set in stone, but the heuristics look sane: "if *no* track in the directory has album set, assume the directory name is album name".

Changing the behaviour would need to be proposed & discussed with all developers on amarok-devel mailing list.
Comment 7 Mathias Dietrich 2013-07-22 07:39:24 UTC
AFAIK this behavior is not 3 years old. I can confirm that this heuristic is used running Amarok-git but definetaly not in Amarok 2.7.1 and before.

To my mind this is not a sane behavior. Why would someone, who removes the album-tag from a song, want a heuristic album, guessed by the path directories.

I will propose this at amarok-devel, this needs dicussion.