Bug 5130 - "Look for new or changed music" causes duplicate "No Album" entries
: "Look for new or changed music" causes duplicate "No Album" entries
Status: RESOLVED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Scanner
: 6.5.3
: PC Windows XP
: P2 normal (vote)
: ---
Assigned To: Squeezebox QA Team email alias
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-06-21 15:13 UTC by Philip Meyer
Modified: 2007-06-24 20:51 UTC (History)
1 user (show)

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philip Meyer 2007-06-21 15:13:06 UTC
I have been removing some ALBUM tags from tracks where I have only ripped a single song from an album,
as I prefer these to appear under "No Album" (I treat them as singles).

If I then do a "Look for new or changed music" rescan, the scanner moves the changed songs to appear
within a new "No Album" entry, rather than add to the existing "No Album" entry.

The more rescans I do, the more entries I get.
Once, I found that the original "No Album" entry disappeared (I had a couple of "No Album" entries, which
correlated to recent rescans, but not the bulk of my "No Album" songs, from my last full scan).

I can correct the music library by doing a full rescan, but this of course takes a lot longer.
Comment 1 KDF 2007-06-21 17:06:24 UTC
I've had this in my local copy for a couple of weeks already to deal with this exact issue. Not committed until it was tested more, but I have no time.

Add after line 1907 of Slim/Schema.pm (in _postCheckAttributes)

		# let the external scanner make an attempt to find any existing "No Album" in the 
		# database before we assume there are none from previous scans
		$_unknownAlbum = Slim::Schema->rs('album')->searchNames($string)->first;
Comment 2 KDF 2007-06-21 17:41:10 UTC
in trunk at chagne 12285.  give it a try and reopen if you find any problems with it.
Comment 3 Philip Meyer 2007-06-22 01:20:08 UTC
Is that 7.0 only, or 6.5.3?  I updated to latest 6.5.3 and didn't notice any change to Slim/Schema.pm.
Comment 4 Chris Owens 2007-06-22 08:27:57 UTC
This would be great to fix in 6.5.3 as well if possible, KDF
Comment 5 Philip Meyer 2007-06-24 01:46:03 UTC
I had a look at applying the patch to my copy of 6.5.3 branch, but $string doesn't exist in the function, so
I have taken a guess at what the patch should be:

   # let the external scanner make an attempt to find any existing "No Album" in the 
   # database before we assume there are none from previous scans
   $_unknownAlbum = Slim::Schema->rs('album')->searchNames(string('NO_ALBUM'))->first;

I applied this just above the following lines:

	# Create a singleton for "No Album"
	# Album should probably have an add() method
Comment 6 Jim McAtee 2007-06-24 20:51:07 UTC
Kevin, can this be safely targeted for 6.5.3?