itunes xml file processing

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1259
    js
    Participant

    Another question (or set of questions) about ratings . . .

    My ideal setup would be for my Mac w/ iTunes to act as a staging area, where I import songs and rate them. I would then have a script to sync new stuff from my “local” iTunes library to the firefly library on a separate machine (which I don’t want iTunes to touch or even know about), and also copy the itunes xml file over to get processed by firefly.

    If I then:
    1)delete some of the files from my Mac, (and thus their metadata is deleted from the xml file),
    2) copy the xml file to firefly (because there may be new or changed ratings)
    3) rescan the library

    Will the songs which I deleted from my iTunes library have their ratings deleted in the firefly database? Does the database actually get deleted and rebuilt when you run a scan? Or just updated with new songs in the library and new metadata from the iTunes xml file? Does the behavior differ on a scan vs. a ‘full scan’?

    What’s the difference between a regular scan and a full scan anyways (i.e., the two buttons on the web interface)? Which is run when mt-daapd is started?

    Thanks!

    #9959
    rpedde
    Participant

    @js wrote:

    Another question (or set of questions) about ratings . . .

    My ideal setup would be for my Mac w/ iTunes to act as a staging area, where I import songs and rate them. I would then have a script to sync new stuff from my “local” iTunes library to the firefly library on a separate machine (which I don’t want iTunes to touch or even know about), and also copy the itunes xml file over to get processed by firefly.

    If I then:
    1)delete some of the files from my Mac, (and thus their metadata is deleted from the xml file),
    2) copy the xml file to firefly (because there may be new or changed ratings)
    3) rescan the library

    Will the songs which I deleted from my iTunes library have their ratings deleted in the firefly database?

    No. The iTunes data is used to update the data in the database if it exists. So if there is no reference in the iTunes database, then it won’t update the song — so it will stay the way it was.

    Now, if you were to touch the file, it would overwrite the data (with blank rating).

    Does the database actually get deleted and rebuilt when you run a scan? Or just updated with new songs in the library and new metadata from the iTunes xml file? Does the behavior differ on a scan vs. a ‘full scan’?

    A regular scan just checks for changed files. If it finds one, it scans it and wipes out the existing database entry (if any) with a new entry. Any files that haven’t changed, it doesn’t touch metadata for.

    A full scan, though, deletes the whole song database and starts from scratch, just like the first time it was run.

    What’s the difference between a regular scan and a full scan anyways (i.e., the two buttons on the web interface)? Which is run when mt-daapd is started?

    Thanks!

    When it’s started, it does a regular scan unless the db schema was updated and it calls for a full scan, or if the songs table is empty (like from an initial startup).

    Hope this helps.

    — Ron

    #9960
    js
    Participant

    @rpedde wrote:

    A regular scan just checks for changed files. If it finds one, it scans it and wipes out the existing database entry (if any) with a new entry. Any files that haven’t changed, it doesn’t touch metadata for.

    How does it decide if a file has changed? Does a changed mtime and/or atime count as a “change”? What about permission or ownership change?

    When it’s started, it does a regular scan unless the db schema was updated and it calls for a full scan

    So if the schema changes, I’d need to dump the ratings from the database before upgrading, and then re-update the database after re-building it?

    I’d like to delete most of the music from my nearly-full ibook drive, and leave firefly as my canonical music library, using iTunes as a mere staging area. Just want to make sure I’m not going to cause myself to lose any ratings in the future! (Ratings are the primary way I “filter” for listening, so it’s very important to me that I don’t clobber them somehow!)

    Thanks for clarifying how the scans work.

    -Jason

    #9961
    rpedde
    Participant

    @js wrote:

    @rpedde wrote:

    A regular scan just checks for changed files. If it finds one, it scans it and wipes out the existing database entry (if any) with a new entry. Any files that haven’t changed, it doesn’t touch metadata for.

    How does it decide if a file has changed? Does a changed mtime and/or atime count as a “change”? What about permission or ownership change?

    Based on mtime, which is file content change. Not atime, which is last accessed time. Otherwise it would reindex every time you played a song. And it doesn’t reindex on permissions or owner change. that’s ctime.

    Or that’s the theory, anyway.

    I really haven’t been in the position where I would have noticed it if it acted differently. But that’s what the code says it does.

    When it’s started, it does a regular scan unless the db schema was updated and it calls for a full scan

    So if the schema changes, I’d need to dump the ratings from the database before upgrading, and then re-update the database after re-building it?

    I’d like to delete most of the music from my nearly-full ibook drive, and leave firefly as my canonical music library, using iTunes as a mere staging area. Just want to make sure I’m not going to cause myself to lose any ratings in the future! (Ratings are the primary way I “filter” for listening, so it’s very important to me that I don’t clobber them somehow!)

    Thanks for clarifying how the scans work.

    -Jason

    Yes, that’s true. I don’t really know how to handle it better. Maybe I could find a way to dump the metadata that isn’t a part of the tag somewhere. I had thought about it before, and it seemed like the “best” way to do it would be to drop a file next to every media file with the supplimentary info in it — like last played time, play count, rating, stuff that wasn’t part of metadata.

    But yuck. What a mess.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.