Bug 343956 - On startup with non empty playlist those tracks are all 'never played'
Summary: On startup with non empty playlist those tracks are all 'never played'
Status: RESOLVED FIXED
Alias: None
Product: amarok
Classification: Applications
Component: Collections/Local (show other bugs)
Version: 2.8-git
Platform: Ubuntu Linux
: HI normal
Target Milestone: 2.9
Assignee: Amarok Developers
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2015-02-09 07:57 UTC by robert marshall
Modified: 2015-06-05 11:57 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 2.9


Attachments
output of stderr from amarok -d (176.49 KB, text/plain)
2015-02-09 07:59 UTC, robert marshall
Details

Note You need to log in before you can comment on or make changes to this bug.
Description robert marshall 2015-02-09 07:57:25 UTC
Since my recent update from git, if I close amarok with a non-empty playlist and then start it again the tracks which were played just before it was closed have - according to edit track details *from the playlist* never been played. If you navigate to that track in the collection the statistics are ok.
Also the cover art is not displayed in the playlist (but is in the collection).
If I then continue playing that playlist as tracks are completed they also don't have the last played time updated.

If I clear the playlist and restart amarok it then behaves correctly.

I don't have write statistics to file enabled

Here's the output of amarok -d on starting with a non-empty playlist (included as an attachment it was too long to put inline)

There's a couple of ERROR lines not sure which (if any) are significant



Reproducible: Always
Comment 1 robert marshall 2015-02-09 07:59:34 UTC
Created attachment 90987 [details]
output of stderr from amarok -d

Output from startup of  amarok
Comment 2 robert marshall 2015-03-12 12:20:39 UTC
Is no-one else seeing this with the git build?

I'm also seeing the problem when I load a playlist. Here's a very short playlist with one track which is in the collection, when when I load it using Playlist->Add Media it claims not to be in my collection. Dragging the same track from the collection gives the correct result.

<?xml version="1.0" encoding="UTF-8"?>
<playlist version="1" xmlns="http://xspf.org/ns/0/">
  <trackList>
    <track>
      <location>../Music/DaCapo/8.226604-24-J.P.E.%20HARTMANN%20Symphony%20no.%201%20in%20G%20minor%2C%20op%2017.%20%281835%2C%20rev%20c%201850%29%20-%20II.%20Andante.mp3</location>
      <identifier>amarok-sqltrackuid://66f76ddd20ae59a0649b4a4c910cc622</identifier>
      <title>J.P.E. HARTMANN: Symphony no. 1 in G minor, op 17. (1835, rev c 1850) - II. Andante</title>
      <creator>Danish National Symphony Orchestra, Thomas Dausgaard (cond)</creator>
      <annotation>The copyright in this recording is owned by Dacapo Records. Browse the full catalogue on www.dacapo-records.dk</annotation>
      <album>Christmas Quiz Sampler 2013</album>
      <trackNum>24</trackNum>
      <duration>335000</duration>
    </track>
  </trackList>
</playlist>

Here's the output of amarok -d while the loading occurs:

amarok: [WARNING] [AmarokNetworkScript] Error fetching data: "www.lyricstime.com: Socket operation timed out" 
amarok: BEGIN: static QScriptValue AmarokScript::Downloader::init(QScriptContext*, QScriptEngine*, bool) 
amarok: END__: static QScriptValue AmarokScript::Downloader::init(QScriptContext*, QScriptEngine*, bool) [Took: 0s] 
X Error: BadWindow (invalid Window parameter) 3
  Major opcode: 20 (X_GetProperty)
  Resource id:  0x1a0676a
amarok: BEGIN: void Playlist::Controller::insertOptioned(Meta::TrackList, Playlist::AddOptions) 
amarok:   BEGIN: virtual void Playlist::InsertTracksCmd::redo() 
amarok:     BEGIN: void Playlist::Model::setAllNewlyAddedToUnplayed() 
amarok:     END__: void Playlist::Model::setAllNewlyAddedToUnplayed() [Took: 0s] 
amarok:     MPRIS2: Queueing up a PropertiesChanged signal 
amarok:   END__: virtual void Playlist::InsertTracksCmd::redo() [Took: 0s] 
amarok: END__: void Playlist::Controller::insertOptioned(Meta::TrackList, Playlist::AddOptions) [Took: 0.001s] 
amarok: BEGIN: void Playlist::PrettyListView::bottomModelRowsInsertedScroll() 
amarok: END__: void Playlist::PrettyListView::bottomModelRowsInsertedScroll() [Took: 0.002s] 
QTimeLine::setPaused: Not running
Calling appendChild() on a null node does nothing.
amarok: BEGIN: static QScriptValue AmarokScript::Downloader::init(QScriptContext*, QScriptEngine*, bool) 
amarok: END__: static QScriptValue AmarokScript::Downloader::init(QScriptContext*, QScriptEngine*, bool) [Took: 0s] 
QTimeLine::setPaused: Not running
amarok: [NetworkAccessManagerProxy] the server is redirecting the request to:  KUrl("http://www.lyricsmania.com") 
amarok: BEGIN: void AmarokScript::AmarokDownloadHelper::requestRedirected(const KUrl&, const KUrl&) 
amarok: END__: void AmarokScript::AmarokDownloadHelper::requestRedirected(const KUrl&, const KUrl&) [Took: 0s] 
amarok: [NetworkAccessManagerProxy] the server is redirecting the request to:  KUrl("http://www.lyricsmania.com/") 
amarok: BEGIN: void AmarokScript::AmarokDownloadHelper::requestRedirected(const KUrl&, const KUrl&) 
amarok: END__: void AmarokScript::AmarokDownloadHelper::requestRedirected(const KUrl&, const KUrl&) [Took: 0s] 
amarok: BEGIN: static QScriptValue AmarokScript::Downloader::init(QScriptContext*, QScriptEngine*, bool) 
amarok: END__: static QScriptValue AmarokScript::Downloader::init(QScriptContext*, QScriptEngine*, bool) [Took: 0s] 
amarok: BEGIN: static QScriptValue AmarokScript::Downloader::init(QScriptContext*, QScriptEngine*, bool) 
amarok: END__: static QScriptValue AmarokScript::Downloader::init(QScriptContext*, QScriptEngine*, bool) [Took: 0s] 
amarok: [SqlRegistry]   albums: 276 (0) of 2117 cached 
amarok: [SqlRegistry]  artists: 232 (-51) of 2585 cached 
amarok: [SqlRegistry]   genres: 27 (-3) of 148 cached 
amarok: [SqlRegistry]   tracks: 188 (-415) of 17282 cached 

Also if I playlist->Add Media and navigate to that file and load it, 'Edit Track Details' claims that it is not in the collection.
Comment 3 Myriam Schweingruber 2015-05-29 12:05:47 UTC
Confirmed on current git, I only tested on Kubuntu 14.10, not on Plasma5, there were no updates in the distribution, so I can only guess this is database related, the only major changes we made recently
Ralf, if you could have a look at it...
Comment 4 Ralf Engels 2015-05-29 17:58:10 UTC
wanted to have a look at that. 
Might be related to my collection changes. Not sure.

Maybe somebody knows how the tracks from the current playlist are persisted. How are they created? Are the tracks of a special type? If they would be local collection tracks then they would not be in "no collection".
Comment 5 robert marshall 2015-05-29 19:11:08 UTC
Not sure if that last bit was a question for me....

I'm seeing it with many track types (flac/ogg/mp3) the tracks are in the Local collection before closing amarok (and 'edit track details' confirms that). On restarting amarok they have lost that status. If you go up to comment 2 you'll see that the same issue occurs with a playlist loaded from an xspf file (saved from within amarok)
Comment 6 Ralf Engels 2015-06-03 21:58:23 UTC
Git commit bc916b4c28383dca5d44efb663014373ca97c69b by Ralf Engels.
Committed on 03/06/2015 at 21:52.
Pushed by rengels into branch 'master'.

Fix tracks are 'never played'

Order of collection was incorrect.
Tracks were found in the file track provider first instead of the
local collection.
Tracks of the type FileTrack usually don't have a collection.

M  +1    -1    src/core-impl/collections/support/CollectionManager.cpp

http://commits.kde.org/amarok/bc916b4c28383dca5d44efb663014373ca97c69b
Comment 7 robert marshall 2015-06-04 12:04:18 UTC
I think there's still one issue with this (but the fix is a great improvement thank you!):

I have within my main ~/Music directory, a soft link to another partition (containing tracks which are - naturally - in the collection but via the soft link). On starting amarok with some of those tracks in the playlist on 'edit track details' their collection is 'None' and the details don't update on playing. On dragging the tracks from the local collection to the playlist they are correctly identified.

If I shouldn't be doing this and should instead be adding the other partition directory to the collection then feel free to ignore this comment!
Comment 8 robert marshall 2015-06-04 14:05:26 UTC
Ignore that comment it's a totally different issue, I only set up that soft link after I opened this bug in February. I agree this one is fixed!