View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0011121 | MMW v4 | Framework: Scripts/Extensions | public | 2013-07-30 16:55 | 2013-09-18 22:33 |
Reporter | zvezdan | Assigned To | |||
Priority | urgent | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 4.1 | ||||
Target Version | 4.1 | Fixed in Version | 4.1 | ||
Summary | 0011121: ISDBSongData::Path = ... is moving file and changing Path property without UpdateDB (reverted) | ||||
Description | All SongData properties are updated only after UpdateDB, but that not apply to Path property which is updated immediately and file is moved even if UpdateDB is not used. | ||||
Tags | No tags attached. | ||||
Fixed in build | 1659 | ||||
|
I confirmed this |
|
Fixed in build 1653. |
|
Verified 1653 |
|
Re-opening, this should be reverted, reasons are here: http://www.mediamonkey.com/forum/viewtopic.php?f=6&t=73673 |
|
Reverted in build 1659. |
|
Well, that user has his reasons about this as I have mine. However, I think that his request has another solution that could be used instead, but mine cannot be done if Path property moves files immediately. He want to move files that are not inside of the Library and he could use ISDBFileSystem::MoveFile instead of the Path property. I am not sure but I think that the only difference between MoveFile and Path is that Path moves additional files with the file specified in the Path property, e.g. .jpg cover files associated with the media file. If it is not the case, i.e. if Path property moves only the specified media file, then there is no reason to not use MoveFile method instead. Actually, your solution is problematic from the start because you are using one SongData property for something that should be done using some additional method. I think that the Path property should modify only the value in the database, and you should have added one new method, e.g. SongData.MoveFile, if the current implementation of the Path property is moving some additional (cover) files or if it is doing some additional tasks beside of moving files, e.g. if it removes emptied folders. By the way, your solution to change Path value only in the database without moving files setting the empty string to the Path property first is a bad programming practice caused with your refusal to add one additional method. |
|
OK, I agree that one could expect that setting Path won't move the file, but because the behaviour has been always documented here http://www.mediamonkey.com/wiki/index.php/ISDBSongData::Path and because by changing it we are breaking older scripts relying on it (as we can see), I would rather leave it as is. I could add an additional method like PathNoMove, but it would be even more cumbersome than the trick documented (setting the empty string to the Path property first) |
|
The solution with setting the empty string to the Path property first is not usable for me because my RegExp script could execute user-defined VBScript expressions that are unknown to me in the moment of writing script and some of them could modify Path during run-time. Actually, it is not problem for me that we don't have one new method which would modify only Path value in the database without moving file. I agree that you should leave this property as it was because of compatibility. However, I would like to have similar property which would modify path (and move file) only after UpdateDB. So, I have one another suggestion which would also resolve my another request (11226). You could add one new method e.g. SongData.PathByMask which would be like RenameByMask, but it would take effect (change Path in database and move file) only after UpdateDB. For example, if I want to get path of some track with applied mask, I would write something like this: oSongData.PathByMask "e:\Music\%A\%S" sText = oSongData.Path ' for displaying purposes ... and when the script is ready to apply that modification it would execute oSongData.UpdateDB. However, if I want to discard that modification it would execute oSongData.DiscardChanges. Of course, if that method is used with some normal path (e.g. c:\My Music\blah blah.mp3, without any tags like %A, %S...) it would behave like existing Path property when you set the same string to it, but with a difference that it is not modifying Path value in the database and moving file immediately. |
|
Added the new ISDBSongData::PathByMask method as described/requested Added in build 1659. |
|
Verified 1659 |