This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Importing from Nightingale (Songbird) to Amarok

Tags: None
(comma "," separated)
User avatar
sparhawk
Registered Member
Posts
433
Karma
0
OS
Hi, I want to move from Nightingale (the Linux port of Songbird) to Amarok, but I wish to keep all the metadata, including playcount and last-played date. Is that possible? I saw a previous discussion on this, but no real answers.

Thanks in advance.
User avatar
Mamarok
Manager
Posts
6071
Karma
16
OS
I don't know how Nightingale stores the play count and last-played data, it all depends on that. If it scrobbles these to last.fm then Amarok 2.7 (to be released in a few days) will be able to synchronize this back, but it all depends on the format of this data. Could you maybe give some more insight in this?
Since quite some time statistics can be written to files in Amarok, if both Nightingale and Amarok use the same format this can be read without problems.

How about duplicating some of your files and add them to the Amarok collection? This should give you an idea if it is possible. But please make sure you use at least Amarok 2.6 or 2.7 beta (synchronization of metadata is only available since 2.7 beta).


Running Kubuntu 22.10 with Plasma 5.26.3, Frameworks 5.100.0, Qt 5.15.6, kernel 5.19.0-23 on Ryzen 5 4600H, AMD Renoir, X11
FWIW: it's always useful to state the exact Plasma version (+ distribution) when asking questions, makes it easier to help ...
User avatar
sparhawk
Registered Member
Posts
433
Karma
0
OS
Thanks for the response.
Mamarok wrote:I don't know how Nightingale stores the play count and last-played data, it all depends on that.

It stores it in an SQlite file, but perhaps the easiest way to get to it is via an xml export, e.g.
Code: Select all
  <mediaitem>
    <last-played>1337409276502</last-played>
    <date-added>1332115736532</date-added>
    <artist>Smog</artist>
    <track>Devotion</track>
    <album>Dongs Of Sevotion</album>
    <duration>354403000</duration>
    <rating>0</rating>
    <play-count>3</play-count>
    <skip-count>0</skip-count>
  </mediaitem>

Mamarok wrote:If it scrobbles these to last.fm then Amarok 2.7 (to be released in a few days) will be able to synchronize this back, but it all depends on the format of this data.

This might be the easiest way, but I'm slightly dubious about how thorough last.fm is with identification of tracks. If I have a direct method that I can use, it might be preferable. But of course, if it's a lot more work, then I might just use this and hope for the best.

Mamarok wrote:Since quite some time statistics can be written to files in Amarok, if both Nightingale and Amarok use the same format this can be read without problems.

This also seems like a good suggestion. It seems that you can write to metadata in Nightingale, but from what I've googled there doesn't necessarily seem to be a standardisation of these statistics? How does Amarok store them? I guess I could work out how Nightingale does it, then write a simple bash script to change the id3 fields to the Amarok method. This might be easier than modifying and importing a monolithic database file.

Mamarok wrote:How about duplicating some of your files and add them to the Amarok collection? This should give you an idea if it is possible. But please make sure you use at least Amarok 2.6 or 2.7 beta (synchronization of metadata is only available since 2.7 beta).

So do you mean that < 2.7 beta Amarok will not read the metadata at all? Just because I am running 2.6.0 and can see the option to write statistics to file.
User avatar
Mamarok
Manager
Posts
6071
Karma
16
OS
Yes, it will, the only thing you will not have with 2.6 is the last.fm synchronization, as that is a new feature in 2.7.

Writing statistics to files is in Amarok since 2.5 or even earlier, can't remember exactly when this was introduced.


Running Kubuntu 22.10 with Plasma 5.26.3, Frameworks 5.100.0, Qt 5.15.6, kernel 5.19.0-23 on Ryzen 5 4600H, AMD Renoir, X11
FWIW: it's always useful to state the exact Plasma version (+ distribution) when asking questions, makes it easier to help ...
User avatar
sparhawk
Registered Member
Posts
433
Karma
0
OS
I just played some files and checked id3 tags. It seems that at least in my version of amarok (2.6.0), it only saves playcount (to FMPS_Playcount), but does not save last-played-date.
User avatar
sparhawk
Registered Member
Posts
433
Karma
0
OS
Okay, I'm ready to give Amarok another go, and I've investigated some options on how to import my statistics in from Nightingale/Songbird into Amarok. I think importing via last.fm is not an option. The last.fm scrobbler can cache songs played while offline, but only if they were played in the last two weeks. I guess I could hack it to thinking that I played all these songs in the last two weeks, but I'm not even sure if that would work.

Thus, I'd prefer to export and import directly. As far as I can see, Amarok can only import from iTunes and old versions of Amarok. Is this correct? If so, are there details on how to get statistics into these formats? As I mentioned earlier, I can get an xml file from Nightingale quite easily, so if the import formats for Amarok are reasonably straightforward, it shouldn't be too hard for me to code a parser.

(FWIW I PMed rengels, who had spoken about creating a Songbird to Amarok importer here, but he didn't reply to my message from over a week ago.)
User avatar
google01103
Manager
Posts
6668
Karma
25
this 2013 GSOC project may be of help interest, specifically the "simplifying" section http://konradzemek.com/


OpenSuse Leap 42.1 x64, Plasma 5.x

User avatar
sparhawk
Registered Member
Posts
433
Karma
0
OS
Thanks for that. Nightingale/Songbird are not supported, but it's probably a good starting point. I've left a message on the blog, and I'll update here with the response.
User avatar
google01103
Manager
Posts
6668
Karma
25
can you export from Nightingale to one of the supported apps?


OpenSuse Leap 42.1 x64, Plasma 5.x

User avatar
Konrad Zemek
Registered Member
Posts
4
Karma
0
OS
sparhawk wrote:Thanks for that. Nightingale/Songbird are not supported, but it's probably a good starting point. I've left a message on the blog, and I'll update here with the response.

For whatever reason your message did not show up on my blog.

Here's a quick-n-dirty Nightingale importer: http://paste.kde.org/pb4a0cda0/
Just `git checkout` my branch, `git apply` the downloaded patch, compile. You will need to export your ratings with Nightingale's "RatingFile" addon, and then choose the created file in importer's configuration dialog.

The easiest way to checkout my branch is to execute
Code: Select all
git clone git://anongit.kde.org/clones/amarok/kzemek/amarok.git -b gsoc-importers

Details about building & running Amarok from git can be found here:
http://blogs.fsfe.org/myriam/2009/09/26 ... l-summary/

Hope that works for you!

Last edited by Konrad Zemek on Sun Sep 22, 2013 3:38 pm, edited 1 time in total.
User avatar
Konrad Zemek
Registered Member
Posts
4
Karma
0
OS
That patch was apparently a little too quick-n-dirty. I've updated it so it works properly with Last Played stat.
User avatar
sparhawk
Registered Member
Posts
433
Karma
0
OS
Thanks so much for the reply and the quick fix.
Konrad Zemek wrote:For whatever reason your message did not show up on my blog.

That's very odd. I didn't get any kind of confirmation after posting, so I tried again immediately. I actually got a "duplicate message" warning, so I presumed it had gone through and was awaiting moderation.

Konrad Zemek wrote:Details about building & running Amarok from git can be found here:
http://blogs.fsfe.org/myriam/2009/09/26 ... l-summary/

I'm actually finding this quite daunting. I've only built something once, and this seems a little more complicated than that. I was wondering if I could impose on you and pm you my xml file so that you can do it for me? I know this is beyond the call of duty for devs, but I really only want to import my library once, then I'd revert to the stable version of Amarok anyway. I understand if this is too much.

==EDIT==
I just realised that Amarok might need access to my local database. Let me know if this is the case and I'll try to build the new version myself. Cheers.
User avatar
Konrad Zemek
Registered Member
Posts
4
Karma
0
OS
sparhawk wrote:That's very odd. I didn't get any kind of confirmation after posting, so I tried again immediately. I actually got a "duplicate message" warning, so I presumed it had gone through and was awaiting moderation.
This may be the first instance of overzealous work on the spam filter's side. I get anywhere between hundreds and thousands of spam messages between logins, so I remove them all without double-checking.

sparhawk wrote:I'm actually finding this quite daunting. I've only built something once, and this seems a little more complicated than that. I was wondering if I could impose on you and pm you my xml file so that you can do it for me?
I could do that but yes, I'd need your database in addition to the xml file. You'd have to pack and send me ~/.kde4/shared/apps/amarok/mysqle directory (this may be ~/.kde/... on Ubuntu).
User avatar
sparhawk
Registered Member
Posts
433
Karma
0
OS
Thanks so much for that!!! I really appreciate it. I've PMed you the links.

(As you know, since you picked this project, it's quite difficult to migrate between music programs, so I appreciate you help out, both in improving Amarok and me personally.)

Thanks again!!!!
User avatar
sparhawk
Registered Member
Posts
433
Karma
0
OS
For anyone else following along… we didn't manage to get my file working on Konrad's system, nor could I get his precomiled binary to work. So back to building from source.

I'm stuck on the `git apply` stage. I've followed the link otherwise, and I presume you `git apply` immediately after `git clone`? While in ~/kde/src? Or in the directory with .git in it (i.e. ~/kde/src/amarok)?

Anyway, I get this
Code: Select all
~/kde/src$ git apply ../nightingalepatch
../nightingalepatch:36: trailing whitespace.
add_subdirectory( nightingale )
fatal: git apply: bad git-diff - expected /dev/null on line 41
~/kde/src$ git apply --check ../nightingalepatch
fatal: git apply: bad git-diff - expected /dev/null on line 41
~/kde/src$ cd amarok
~/kde/src/amarok$ git apply ../../nightingalepatch
../../nightingalepatch:36: trailing whitespace.
add_subdirectory( nightingale )
fatal: git apply: bad git-diff - expected /dev/null on line 41
~/kde/src/amarok$ git apply --check ../../nightingalepatch
fatal: git apply: bad git-diff - expected /dev/null on line 41


Bookmarks



Who is online

Registered users: bancha, Bing [Bot], Evergrowing, Google [Bot], lockheed, mesutakcan, sandyvee