View Issue Details

IDProjectCategoryView StatusLast Update
0019268MMW 5Extensions frameworkpublic2022-07-22 17:08
Reporterzvezdan Assigned To 
PrioritynoneSeverityminorReproducibilityN/A
Status feedbackResolutionopen 
Summary0019268: app.db.ProcessPaths method needed
DescriptionI need the mentioned method to force update of folders in the Folders table and Songs.IDFolder field after changes of Songs.SongPath, which are caused by update_songs_songpath trigger and stored in the PathProcessing table.

I am using a workaround to that in my add-on, but the problem with any workaround is that:
1. maybe there are situations when it could not work, and/or
2. it is unofficial and, if you change something in your program related to that workaround, it could be broken and unusable for my add-on.

You already have the requested code for the mentioned method, you only need to expose it to the scripts.
TagsNo tags attached.
Fixed in build

Activities

Ludek

2022-07-22 10:49

developer   ~0068871

Last edited: 2022-07-22 10:53

FYI: If you use existing method app.filesystem.renameFiles : https://www.mediamonkey.com/docs/api/classes/Filesystem.html#method_renameFiles
Then it will do all the necessary DB updates to the changed path (together with moving/copying the files).

If the files are already deadlinks then you can change the path property of a track(s) directly and then call commitAsync.
e.g.
fastForEach(tracklist, function (track) {
   track.path = newPath;
});
tracklist.commitAsync(); // does all the necessary DB upgrades

Or is there a good reason to not use the methods above?

zvezdan

2022-07-22 17:08

updater   ~0068882

I already explained it here: https://www.ventismedia.com/mantis/view.php?id=19156#c68828

"I don't want to use renameFiles because it cannot move non-media files, which I have already reported (https://www.ventismedia.com/mantis/view.php?id=19103), and that doesn't resolve a requisite to update paths after moving files outside of the program."

I am using SQL to bulk update paths, not one by one track using tracklist methods. There is a very good reason for that, called speed. And even simplicity.