exterminador Posted June 27, 2022 Report Share Posted June 27, 2022 Hi, I've been having an issue when moving files from one folder to another in Daminion for a while. What happens is the file is correctly moved in the file system but the folder path in Daminion stays as the original one. I do not recall on which version this started to happen. It has not been a big issue as I found a while ago that updating the RelativePath field in the Files table fixes the issue. This doesn't happens with all files. Just yesterday I found what's happening. At some point, there was an update that added a field "id_mediaitem" in the files table. At some other point, at least in my database, the files.id field became different than the files.id_mediaitem. What I found in the debug log is the following update sentence is assuming the id field is equal the MediaItemId which is not: UPDATE Files SET OfflineFilePath = @OfflineFilePath, RelativePath = @RelativePath WHERE IsPrimary and Id = @MediaItemId (@OfflineFilePath=\\htpc\Folder2, @RelativePath=\\htpc\Folder2, @MediaItemId=2306236) I think the update should point to the files.id_mediaitem field so it is the right one in all cases. Hope this can be fixed on the next versions. I'm adding the log entries of the procedure: 2022-06-27 00:52:18,919 [21] DEBUG PicaJet.Daminion.Service.Utils.MoveItemToFolderCommand [(null)] - Start: (881) 2022-06-27 00:52:18,925 [21] DEBUG SQL [(null)] - select ID, Value, HelperValue, ParentValueId, IndexedTagId, SortOrder, IsGroup, HasChilds, IsDefaultValue, HierarchyLevel, Id_Icon, IsApproved, exists (select 1 from (select outTagId, outTagValueId, inTagId, inTagValueId from tagLinks) t where (t.outTagId = indexedtagid and t.outTagValueId = id) or (t.inTagid = indexedtagid and t.inTagValueId = id)) as HasTagLinks from Folder_Table where Id = @Id (@Id=4472) 2022-06-27 00:52:18,929 [21] DEBUG SQL [(null)] - select ID, Value, HelperValue, ParentValueId, IndexedTagId, SortOrder, IsGroup, HasChilds, IsDefaultValue, HierarchyLevel, Id_Icon, IsApproved, exists (select 1 from (select outTagId, outTagValueId, inTagId, inTagValueId from tagLinks) t where (t.outTagId = indexedtagid and t.outTagValueId = id) or (t.inTagid = indexedtagid and t.inTagValueId = id)) as HasTagLinks from Folder_Table where Id = @Id (@Id=3934) 2022-06-27 00:52:18,933 [21] DEBUG SQL [(null)] - select ID, Value, HelperValue, ParentValueId, IndexedTagId, SortOrder, IsGroup, HasChilds, IsDefaultValue, HierarchyLevel, Id_Icon, IsApproved, exists (select 1 from (select outTagId, outTagValueId, inTagId, inTagValueId from tagLinks) t where (t.outTagId = indexedtagid and t.outTagValueId = id) or (t.inTagid = indexedtagid and t.inTagValueId = id)) as HasTagLinks from Folder_Table where Id = @Id (@Id=1848) 2022-06-27 00:52:18,936 [21] DEBUG SQL [(null)] - select ID, Value, HelperValue, ParentValueId, IndexedTagId, SortOrder, IsGroup, HasChilds, IsDefaultValue, HierarchyLevel, Id_Icon, IsApproved, exists (select 1 from (select outTagId, outTagValueId, inTagId, inTagValueId from tagLinks) t where (t.outTagId = indexedtagid and t.outTagValueId = id) or (t.inTagid = indexedtagid and t.inTagValueId = id)) as HasTagLinks from Folder_Table where Id = @Id (@Id=1847) 2022-06-27 00:52:18,940 [21] DEBUG SQL [(null)] - select RelativePath, FileName from Files where isPrimary and Id_MediaItem = @MediaItemId (@MediaItemId=2306236) 2022-06-27 00:52:19,586 [21] DEBUG SQL [(null)] - UPDATE Files SET OfflineFilePath = @OfflineFilePath, RelativePath = @RelativePath WHERE IsPrimary and Id = @MediaItemId (@OfflineFilePath=\\htpc\Folder2, @RelativePath=\\htpc\Folder2, @MediaItemId=2306236) 2022-06-27 00:52:19,594 [21] DEBUG SQL [(null)] - UPDATE Folder_File SET Id_Value = @FolderId where Id_MediaItem = @MediaItemId (@FolderId=4472, @MediaItemId=2306236) 2022-06-27 00:52:19,600 [21] DEBUG PicaJet.Daminion.Service.Utils.MoveItemToFolderCommand [(null)] - End: (881) Thanks and regards! Quote Link to comment Share on other sites More sharing options...
Daria Kotilainen Posted June 28, 2022 Report Share Posted June 28, 2022 Hi, please install the latest build 2734 - this should help with the issue Daria Quote Link to comment Share on other sites More sharing options...
exterminador Posted June 30, 2022 Author Report Share Posted June 30, 2022 Thanks a lot Daria! I've updated and stopped having this issue. Best regards! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.