Failure to restore backuped playlist
When trying to restore a backed up playlist after a migration, it sometimes fails.
Logs are attached: logs.txt
The relevant bits for the playlist restore are
2019-08-29 18:07:54.117 14941-14983/org.videolan.vlc.debug D/VLC/medialibrary: ../src/metadata_services/MetadataParser.cpp:186 addPlaylistMedias Try to import file:///storage/emulated/0/Android/data/org.videolan.vlc.debug/files/medialib/playlists/1.xspf as a playlist
2019-08-29 18:07:54.141 14941-14983/org.videolan.vlc.debug D/VLC/medialibrary: ../src/metadata_services/MetadataParser.cpp:263 addPlaylistElement Try to add file:///storage/emulated/0/Music/Wolfgang%20Amadeus%20Mozart%20-%20Holliger%20Wind%20Ensemble%20-%20Staatskapelle%20Dresden%20-%20Sir%20Colin%20Davis%20-%20Peter%20Schreier/W.%20A.%20Mozart%2A%2C%20Holliger%20Wind%20Ensemble%2C%20Staatskapelle%20Dresden%2C%20Sir%20Colin%20Davis%2C%20Peter%20Schreier%20-%20Musica%20Massonica/13%20-%20adagio-e-fuga-in-do-minore-k-546.mp3 to the playlist file:///storage/emulated/0/Android/data/org.videolan.vlc.debug/files/medialib/playlists/1.xspf
2019-08-29 18:07:54.143 14941-14983/org.videolan.vlc.debug D/VLC/medialibrary: ../src/metadata_services/MetadataParser.cpp:309 addPlaylistElement Importing file file:///storage/emulated/0/Music/Wolfgang%20Amadeus%20Mozart%20-%20Holliger%20Wind%20Ensemble%20-%20Staatskapelle%20Dresden%20-%20Sir%20Colin%20Davis%20-%20Peter%20Schreier/W.%20A.%20Mozart%2A%2C%20Holliger%20Wind%20Ensemble%2C%20Staatskapelle%20Dresden%2C%20Sir%20Colin%20Davis%2C%20Peter%20Schreier%20-%20Musica%20Massonica/13%20-%20adagio-e-fuga-in-do-minore-k-546.mp3 in the playlist file:///storage/emulated/0/Android/data/org.videolan.vlc.debug/files/medialib/playlists/1.xspf
2019-08-29 18:07:54.171 14941-14983/org.videolan.vlc.debug D/VLC/medialibrary: ../src/metadata_services/MetadataParser.cpp:263 addPlaylistElement Try to add file:///storage/emulated/0/Music/The%20Reflex/The%20Reflex%20-%20Million%20Sellers%20Vol%E2%80%8B.%E2%80%8B4/11%20-%20angel-dust-the-reflex-revision.mp3 to the playlist file:///storage/emulated/0/Android/data/org.videolan.vlc.debug/files/medialib/playlists/1.xspf
2019-08-29 18:07:54.171 14941-14978/org.videolan.vlc.debug I/VLC/medialibrary: ../src/discoverer/DiscovererWorker.cpp:304 runDiscover Running discover on: file:///storage/emulated/0/
2019-08-29 18:07:54.172 14941-14983/org.videolan.vlc.debug D/VLC/medialibrary: ../src/metadata_services/MetadataParser.cpp:309 addPlaylistElement Importing file file:///storage/emulated/0/Music/The%20Reflex/The%20Reflex%20-%20Million%20Sellers%20Vol%E2%80%8B.%E2%80%8B4/11%20-%20angel-dust-the-reflex-revision.mp3 in the playlist file:///storage/emulated/0/Android/data/org.videolan.vlc.debug/files/medialib/playlists/1.xspf
2019-08-29 18:07:54.174 14941-14983/org.videolan.vlc.debug D/VLC/medialibrary: ../src/metadata_services/MetadataParser.cpp:263 addPlaylistElement Try to add file:///storage/emulated/0/Music/Velcra/Velcra%20-%20Consequences%20Of%20Disobedience/2%20-%20big-brother.mp3 to the playlist file:///storage/emulated/0/Android/data/org.videolan.vlc.debug/files/medialib/playlists/1.xspf
2019-08-29 18:07:54.175 14941-14983/org.videolan.vlc.debug D/VLC/medialibrary: ../src/metadata_services/MetadataParser.cpp:309 addPlaylistElement Importing file file:///storage/emulated/0/Music/Velcra/Velcra%20-%20Consequences%20Of%20Disobedience/2%20-%20big-brother.mp3 in the playlist file:///storage/emulated/0/Android/data/org.videolan.vlc.debug/files/medialib/playlists/1.xspf
2019-08-29 18:07:54.176 14941-14983/org.videolan.vlc.debug D/VLC/medialibrary: ../src/parser/ParserWorker.cpp:215 mainloop Done executing Metadata task on file:///storage/emulated/0/Android/data/org.videolan.vlc.debug/files/medialib/playlists/1.xspf in 87ms. Result: 4
The last line, with result 4, indicates that the playlist analysis task completed successfully (4 is parser::Status::Completed
)
However all of this tasks should have fired a discoverer which should have synchronously create 2 tasks:
- A Creation task, which involves creating the media
- A linking task, which will try to link the media with the playlist.
The discovery process is handled from medialibrary/src/metadata_services/MetadataParser.cpp
, lines 309 to 347, depending on the cases.
For a file which is located in a unknown folder (the folder has to be unknown since the database has just been flushed), the relevant code path should be
auto probePtr = std::unique_ptr<prober::PathProbe>(
new prober::PathProbe{ utils::file::toLocalPath( mrl ),
isDirectory, parentFolder,
utils::file::toLocalPath( directoryMrl ),
playlistPtr->id(), subitem.linkExtra(), false } );
FsDiscoverer discoverer( fsFactory, m_ml, nullptr, std::move( probePtr ) );
if ( parentKnown == false )
{
discoverer.discover( entryPoint, *this );
auto entryFolder = Folder::fromMrl( m_ml, entryPoint );
if ( entryFolder != nullptr )
Folder::excludeEntryFolder( m_ml, entryFolder->id() );
return;
}
But the logs don't show any obvious failure...
I'm not sure what to suggest beside sprinkling LOG_ERROR
everywhere in MetadataAnalyzer::addPlaylistElement
and in FsDiscoverer::checkFolder
and FsDiscoverer::addFolder
For reference, here's the associated functional test output on my machine:
Debug: ../src/metadata_services/MetadataParser.cpp:263 addPlaylistElement Try to add file:///home/chouquette/dev/medialibrary/test/samples/samples/playlist/tracks/track.mp3 to the playlist file:///tmp/ml_folder/playlists/1.xspf
Debug: ../src/metadata_services/MetadataParser.cpp:309 addPlaylistElement Importing file file:///home/chouquette/dev/medialibrary/test/samples/samples/playlist/tracks/track.mp3 in the playlist file:///tmp/ml_folder/playlists/1.xspf
Info: ../src/discoverer/FsDiscoverer.cpp:413 addFolder Creating new device in DB 49665d40-73ae-4134-b2f6-b421411b9508
Debug: ../src/discoverer/FsDiscoverer.cpp:268 checkFolder Checking for modifications in file:///home/
Debug: ../src/discoverer/FsDiscoverer.cpp:291 checkFolder New folder detected: file:///home/chouquette/
Debug: ../src/discoverer/FsDiscoverer.cpp:268 checkFolder Checking for modifications in file:///home/chouquette/
Debug: ../src/discoverer/FsDiscoverer.cpp:291 checkFolder New folder detected: file:///home/chouquette/dev/
Debug: ../src/discoverer/FsDiscoverer.cpp:268 checkFolder Checking for modifications in file:///home/chouquette/dev/
Debug: ../src/discoverer/FsDiscoverer.cpp:291 checkFolder New folder detected: file:///home/chouquette/dev/medialibrary/
Debug: ../src/discoverer/FsDiscoverer.cpp:268 checkFolder Checking for modifications in file:///home/chouquette/dev/medialibrary/
Debug: ../src/discoverer/FsDiscoverer.cpp:291 checkFolder New folder detected: file:///home/chouquette/dev/medialibrary/test/
Debug: ../src/discoverer/FsDiscoverer.cpp:268 checkFolder Checking for modifications in file:///home/chouquette/dev/medialibrary/test/
Debug: ../src/discoverer/FsDiscoverer.cpp:291 checkFolder New folder detected: file:///home/chouquette/dev/medialibrary/test/samples/
Debug: ../src/discoverer/FsDiscoverer.cpp:268 checkFolder Checking for modifications in file:///home/chouquette/dev/medialibrary/test/samples/
Debug: ../src/discoverer/FsDiscoverer.cpp:291 checkFolder New folder detected: file:///home/chouquette/dev/medialibrary/test/samples/samples/
Debug: ../src/discoverer/FsDiscoverer.cpp:268 checkFolder Checking for modifications in file:///home/chouquette/dev/medialibrary/test/samples/samples/
Debug: ../src/discoverer/FsDiscoverer.cpp:291 checkFolder New folder detected: file:///home/chouquette/dev/medialibrary/test/samples/samples/playlist/
Debug: ../src/discoverer/FsDiscoverer.cpp:268 checkFolder Checking for modifications in file:///home/chouquette/dev/medialibrary/test/samples/samples/playlist/
Debug: ../src/discoverer/FsDiscoverer.cpp:291 checkFolder New folder detected: file:///home/chouquette/dev/medialibrary/test/samples/samples/playlist/tracks/
Debug: ../src/discoverer/FsDiscoverer.cpp:268 checkFolder Checking for modifications in file:///home/chouquette/dev/medialibrary/test/samples/samples/playlist/tracks/
Debug: ../src/discoverer/FsDiscoverer.cpp:335 checkFiles Checking file in file:///home/chouquette/dev/medialibrary/test/samples/samples/playlist/tracks/
You can see the playlist item path getting probed by the FsDiscoverer, which doesn't happen in the attached logs. Maybe it's just a matter of the MRL being invalid which causes an error when trying to access the path, but this should have a more obvious error.