View Issue Details

IDProjectCategoryView StatusLast Update
0007548MMW v4Framework: Scripts/Extensionspublic2011-03-30 09:00
Reporterzvezdan Assigned To 
PriorityhighSeverityminorReproducibilityalways
Status assignedResolutionopen 
Summary0007548: SDBSongData.UpdateDB adds tracks from My Computer to Library (if they are not there already)
DescriptionI think this "feature" was added somewhere in between 3.0.6.1199 and 3.2.0.1294, i.e. 1199 never adds tracks and 1294 mostly adds tracks (although I got one situation when it didn't add track, but I cannot reproduce it); MM4 always adds tracks.

OK, this is discussable if you should keep such behavior or not, but I have a problem with it because users of my script don't want to get added tracks to the library whenever they change some tags with my script (http://www.mediamonkey.com/forum/viewtopic.php?p=291593#p291593).

Now, I could write something like this:
    If oSongData.SongID <> -1 Then
        oSongData.UpdateDB
        oSongData.UpdateAlbum
        oSongData.UpdateArtist
    End If
    oSongData.WriteTags

However, in such case the main tracklist is not updated. I could add:
    SDB.MainTracksWindow.Refresh
but that line is time consuming, especially if the tracklist contains too many tracks. You see, with 3.0.6.1199 and earlier versions when I use UpdateDB on tracks from My Computer node, the refresh of the tracklist is done almost immediately. There are also situations when Refresh of the tracklist is not advisable for many another reasons, not only because of its slow speed.

I tried also to set IsntInDB for tracks outside the Library:
    If oSongData.SongID = -1 Then
        oSongData.IsntInDB = True
    End If
    If Not oSongData.IsntInDB Then
        oSongData.UpdateDB
        oSongData.UpdateAlbum
        oSongData.UpdateArtist
    End If
    oSongData.WriteTags
but in that case tracks are added to the Library always.

So, I have two proposals:
1. if IsntInDB is true, track should not be added to the library when we use UpdateDB; or
2. add some new method to refresh only modified tracks in the tracklist, not the full tracklist, e.g. SDB.MainTracksWindow.RefreshOnlyModifiedTracks.
TagsNo tags attached.
Fixed in build

Activities

jiri

2011-03-22 08:42

administrator   ~0023815

Petr, any idea whether suggestion 1. would cause any regression? I'd say that it could be quite safe.

zvezdan

2011-03-30 09:00

updater   ~0023972

I am sorry, I just tried several older versions on another computer, even v2.5, and it seems that MM always added tracks to the Library when UpdateDB is applied.

By the way, I forgot to say that my first suggestion has not any use if you don't refresh the tracklist on UpdateDB. When I say refresh, I don't mean on full refresh as it is with the press of F5 key, but same refresh as when we change some tag of some track e.g. using Properties dialog box. Hence, my second suggestion could be implemented independently of the first one.