Opened 12 years ago

Closed 12 years ago

#2958 closed enhancement (fixed)

Database cleanup in MythMusic

Reported by: otto at kolsi dot fi Owned by: stuartm
Priority: minor Milestone: 0.21
Component: mythmusic Version: head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

MythMusic does not clean album, artist or genre tables and thus if songs are removed, there is a good change that the database starts to grow up because there are left-overs in album, artist and genre tables.

Attached patch adds database cleanup to MythMusic. Cleanup deletes rows from the music_genres, music_albums and music_artists that are now longer "linked" to any song in music_songs.

This cleanup is performed only when songs are removed from the DB and not everytime songs are re-scanned. This is because cleanup operation might take a while if you have large collection and/or slow machine.

This means that if you only add or modify songs, DB is never cleaned. It this needs to be addressed, maybe a manual action/task could be added to the MusicTools? menu.

Attachments (1)

mythmusic_cleanup.diff (1.8 KB) - added by otto at kolsi dot fi 12 years ago.

Download all attachments as: .zip

Change History (5)

Changed 12 years ago by otto at kolsi dot fi

Attachment: mythmusic_cleanup.diff added

comment:1 Changed 12 years ago by stuartm

Milestone: unknown0.21
Owner: changed from Isaac Richards to stuartm

I'd missed this patch before now. I'd noted that we weren't cleaning up and it was on my list for #3041

I wouldn't worry about updating the patch, I'll merge in the changes manually.

comment:2 Changed 12 years ago by stuartm

Just for the record, Subqueries as used in the patch aren't supported in mysql 3.23 and can't be used until we drop support for 3.23 (probably after 0.21 is released).

comment:3 in reply to:  2 Changed 12 years ago by anonymous

Replying to stuartm:

Just for the record, Subqueries as used in the patch aren't supported in mysql 3.23 and can't be used until we drop support for 3.23 (probably after 0.21 is released).

Okay. Similar cleanup as used in the patch should now also be made to this new music_directories -table (regardless of the cleanup being implemented differently or postponed until mysql 3.23 support is dropped).

comment:4 Changed 12 years ago by stuartm

Resolution: fixed
Status: newclosed

(In [13322]) Closes #2958

Applies a modified patch to remove orphaned entries from the genre, artist, album and albumart tables.

Note: See TracTickets for help on using tickets.