Task can't be resume if a removable device changed its mountpoint
The issue exhibits itself on iOS, where we try to rescan all the media as part of the 16->17 migration, but their location changed, since the "app folder" changes each time the application runs.
This leads to a case where we have an MRL for the task (and also a file_id), but when we try to restore the FS instances, it fails because the mrl isn't valid anymore:
Error: /Users/bubu/Projects/videolabs/VLCMediaLibraryKit/libmedialibrary/medialibrary/src/utils/Directory.cpp:87 toAbsolute Failed to convert /Users/bubu/Library/Developer/CoreSimulator/Devices/353A33DD-F9B3-4923-A908-A3C052DC05F9/data/Containers/Data/Application/041C2071-FAB2-49C9-8F7A-3FDE1A443B4D/Documents/ to absolute path
Error: /Users/bubu/Projects/videolabs/VLCMediaLibraryKit/libmedialibrary/medialibrary/src/parser/Task.cpp:386 restoreLinkedEntities Failed to restore task: Failed to convert to absolute path: No such file or directory
Info: /Users/bubu/Projects/videolabs/VLCMediaLibraryKit/libmedialibrary/medialibrary/src/parser/Task.cpp:330 restoreLinkedEntities Restoring linked entities of task 2
We should be able to either use the file_id (which in itself is plenty enough), or to fallback to it in case we can't find the file. I need to re-read and document the code better, since I'm quite confused by what seems to be hacked around fixes for some edge cases. Damn you past me...
It's unclear why we'd need to parse an external file, as the comment
// MRL will be empty if the task has been resumed from unparsed files
// parentFolderId == 0 indicates an external file
seems to indicate we can do
And it seems that there is support for removable files, as
// We might re-create tasks without mrl to ease the handling of files on
// external storage.
shows.
It might not be a large code change, but I'd like to avoid screwing this up and causing yet another migration.