medialibrary issueshttps://code.videolan.org/videolan/medialibrary/-/issues2022-01-05T17:08:46Zhttps://code.videolan.org/videolan/medialibrary/-/issues/402Broken initialization API2022-01-05T17:08:46ZHugo Beauzée-LuyssenBroken initialization APISince recent changes, the media library expects a `SetupConfig*` parameter which can contain instances of device listers, fs factories, and metadata extractor.
The issue is that some of those instances might need a pointer to the media ...Since recent changes, the media library expects a `SetupConfig*` parameter which can contain instances of device listers, fs factories, and metadata extractor.
The issue is that some of those instances might need a pointer to the media library instance to perform their initialization. Specifically, the FS factories are often expecting a medialib instance in order to fetch a device lister (especially for the `file://` one which uses the builtin one and has no other way of fetching it)
This means that the SetupConfig can't be passed to the constructor, or that a new API needs to be added in order for the FS factory to be able to fetch its device lister.0.11.xHugo Beauzée-LuyssenHugo Beauzée-Luyssenhttps://code.videolan.org/videolan/medialibrary/-/issues/400External playlists aren't converted to/from internal2021-12-20T13:46:33ZHugo Beauzée-LuyssenExternal playlists aren't converted to/from internalThis is what we do for media, and we need to do the same for playlists, otherwise once a new folder gets analyzed, if it contains a playlist that was inserted as an external one if will failed to be reinserted.
This can probably be exhi...This is what we do for media, and we need to do the same for playlists, otherwise once a new folder gets analyzed, if it contains a playlist that was inserted as an external one if will failed to be reinserted.
This can probably be exhibited quite easily by implementing the internal -> external conversion when the parent folder gets removed, which will lead to some trouble in the `ParseTwice` functional test suite0.11.xHugo Beauzée-LuyssenHugo Beauzée-Luyssenhttps://code.videolan.org/videolan/medialibrary/-/issues/399Crash after calling clearDatabase a couple of times in a row2021-12-13T15:40:51ZDuncan McNamaraCrash after calling clearDatabase a couple of times in a rowWhen calling clearDatabase from vlc-android-tv settings a couple of times it crashes.
Only occurs on Sony Bravia TVs
Logs: [bravia-crash.log](/uploads/6bf1859059ccdfc06106dd9fac07bff3/bravia-crash.log)
Database: [vlc_media.db](/uploads...When calling clearDatabase from vlc-android-tv settings a couple of times it crashes.
Only occurs on Sony Bravia TVs
Logs: [bravia-crash.log](/uploads/6bf1859059ccdfc06106dd9fac07bff3/bravia-crash.log)
Database: [vlc_media.db](/uploads/9b82e2862f194418debd851a2ee9ea8b/vlc_media.db)0.11.xHugo Beauzée-LuyssenHugo Beauzée-Luyssenhttps://code.videolan.org/videolan/medialibrary/-/issues/398Use new VLC stats to get modification time and size2022-01-21T18:28:30ZHugo Beauzée-LuyssenUse new VLC stats to get modification time and sizeSince https://code.videolan.org/videolan/vlc/-/merge_requests/923 we can now get all the information we need without computing those ourselves.
This will require a libvlcpp bump beforeSince https://code.videolan.org/videolan/vlc/-/merge_requests/923 we can now get all the information we need without computing those ourselves.
This will require a libvlcpp bump before0.11.xHugo Beauzée-LuyssenHugo Beauzée-Luyssenhttps://code.videolan.org/videolan/medialibrary/-/issues/397Potential deadlock when replacing external libvlc instance2022-01-05T09:10:25ZHugo Beauzée-LuyssenPotential deadlock when replacing external libvlc instancehttps://code.videolan.org/videolan/medialibrary/-/jobs/848415
```
Thread 8 (Thread 0x7fcc915d6700 (LWP 110916) "samples"):
#0 0x00007fcc98791e2b in __lll_lock_wait () from /lib/x86_64-linux-gnu/libpthread.so.0
#1 0x00007fcc9878a843 in...https://code.videolan.org/videolan/medialibrary/-/jobs/848415
```
Thread 8 (Thread 0x7fcc915d6700 (LWP 110916) "samples"):
#0 0x00007fcc98791e2b in __lll_lock_wait () from /lib/x86_64-linux-gnu/libpthread.so.0
#1 0x00007fcc9878a843 in pthread_mutex_lock () from /lib/x86_64-linux-gnu/libpthread.so.0
#2 0x000055f67b2d51fb in __gthread_mutex_lock (__mutex=0x616000000088) at /usr/include/x86_64-linux-gnu/c++/10/bits/gthr-default.h:749
#3 0x000055f67b2d566d in std::mutex::lock (this=0x616000000088) at /usr/include/c++/10/bits/std_mutex.h:100
#4 0x000055f67b2fa026 in std::unique_lock<std::mutex>::lock (this=0x7fcc915d4680) at /usr/include/c++/10/bits/unique_lock.h:138
#5 0x000055f67b2e4113 in std::unique_lock<std::mutex>::unique_lock (this=0x7fcc915d4680, __m=...) at /usr/include/c++/10/bits/unique_lock.h:68
#6 0x00007fcc9b17fe1e in medialibrary::MediaLibrary::getParser (this=0x616000000080) at ../src/MediaLibrary.cpp:2173
#7 0x00007fcc9b10b9a9 in medialibrary::MediaLibrary::onDiscoveredFile (this=0x616000000080, fileFs=std::shared_ptr<medialibrary::fs::IFile> (use count 2, weak count 0) = {...}, parentFolder=std::shared_ptr<medialibrary::Folder> (use count 3, weak count 0) = {...}, parentFolderFs=std::shared_ptr<medialibrary::fs::IDirectory> (use count 3, weak count 0) = {...}, fileType=medialibrary::IFile::Type::Playlist) at ../src/MediaLibrary.cpp:808
#8 0x00007fcc9b3c846e in medialibrary::FsDiscoverer::checkFiles (this=0x60c00003a180, parentFolderFs=std::shared_ptr<medialibrary::fs::IDirectory> (use count 3, weak count 0) = {...}, parentFolder=std::shared_ptr<medialibrary::Folder> (use count 3, weak count 0) = {...}) at ../src/discoverer/FsDiscoverer.cpp:547
#9 0x00007fcc9b3c16d4 in medialibrary::FsDiscoverer::checkFolder (this=0x60c00003a180, folderFs=std::shared_ptr<medialibrary::fs::IDirectory> (empty) = {...}, folder=std::shared_ptr<medialibrary::Folder> (empty) = {...}, fsFactory=...) at ../src/discoverer/FsDiscoverer.cpp:425
#10 0x00007fcc9b3b8d47 in medialibrary::FsDiscoverer::reloadFolder (this=0x60c00003a180, f=std::shared_ptr<medialibrary::Folder> (empty) = {...}, fsFactory=...) at ../src/discoverer/FsDiscoverer.cpp:90
#11 0x00007fcc9b3bcd44 in medialibrary::FsDiscoverer::reload (this=0x60c00003a180, entryPoint="file:///builds/videolan/medialibrary/test/samples/samples/playlist/external_folder/") at ../src/discoverer/FsDiscoverer.cpp:244
#12 0x00007fcc9b3895bd in medialibrary::DiscovererWorker::runReload (this=0x60f000012e20, entryPoint="file:///builds/videolan/medialibrary/test/samples/samples/playlist/external_folder/") at ../src/discoverer/DiscovererWorker.cpp:507
#13 0x00007fcc9b3880eb in medialibrary::DiscovererWorker::run (this=0x60f000012e20) at ../src/discoverer/DiscovererWorker.cpp:454
```
```
Thread 1 (Thread 0x7fcc9655a100 (LWP 110634) "samples"):
#0 0x00007fcc987894a7 in __pthread_clockjoin_ex () from /lib/x86_64-linux-gnu/libpthread.so.0
#1 0x00007fcc985680e3 in std::thread::join() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#2 0x00007fcc9b37f25e in medialibrary::DiscovererWorker::stop (this=0x60f000012e20) at ../src/discoverer/DiscovererWorker.cpp:88
#3 0x00007fcc9b185017 in medialibrary::MediaLibrary::setExternalLibvlcInstance (this=0x616000000080, inst=0x6080000ccfa0) at ../src/MediaLibrary.cpp:2445
#4 0x000055f67b275abc in ReplaceVlcInstance (T=0x60f000000040) at ../test/samples/main.cpp:115
#5 0x000055f67b280c8d in main (ac=3, av=0x7ffd724f9a78) at ../test/samples/main.cpp:240
```0.11.xHugo Beauzée-LuyssenHugo Beauzée-Luyssenhttps://code.videolan.org/videolan/medialibrary/-/issues/396When grouping by folder, empty name if folder is not present2021-11-29T13:52:40ZNicolas PomepuyWhen grouping by folder, empty name if folder is not presentWhen grouping by folder and a device is not present, all the folders from this device have an empty name if the files are from the device root.
![device-2021-11-29-141214](/uploads/24b313754fdcf5754d4b6a7c5810ef8e/device-2021-11-29-1412...When grouping by folder and a device is not present, all the folders from this device have an empty name if the files are from the device root.
![device-2021-11-29-141214](/uploads/24b313754fdcf5754d4b6a7c5810ef8e/device-2021-11-29-141214.png)
Reproduced on the `0.9.x` branch0.11.xHugo Beauzée-LuyssenHugo Beauzée-Luyssenhttps://code.videolan.org/videolan/medialibrary/-/issues/395Playlist internal counters are not updated by clearContent2021-11-23T16:55:07ZHugo Beauzée-LuyssenPlaylist internal counters are not updated by clearContentWhen invoking clearContent, none of the playlist internal counter are reset.
If we were to test those in the `Rescan` suite, all tests would fail (which they do when implementing #393 :grimacing:)
This needs to be fixed in 0.11 and bac...When invoking clearContent, none of the playlist internal counter are reset.
If we were to test those in the `Rescan` suite, all tests would fail (which they do when implementing #393 :grimacing:)
This needs to be fixed in 0.11 and backported to 0.10.10.10.1Hugo Beauzée-LuyssenHugo Beauzée-Luyssenhttps://code.videolan.org/videolan/medialibrary/-/issues/394Please use system xxhash if available2021-11-23T23:00:10ZSebastian RamacherPlease use system xxhash if availableWe have [xxhash](https://tracker.debian.org/pkg/xxhash) packaged in Debian. Hence, it would be nice if the build system would check if the packaged version is available and use it if that's the case.We have [xxhash](https://tracker.debian.org/pkg/xxhash) packaged in Debian. Hence, it would be nice if the build system would check if the packaged version is available and use it if that's the case.0.11.xHugo Beauzée-LuyssenHugo Beauzée-Luyssenhttps://code.videolan.org/videolan/medialibrary/-/issues/391Remove now unused IAlbumTrack.h header2021-11-16T13:56:33ZHugo Beauzée-LuyssenRemove now unused IAlbumTrack.h headerFollowing #379 we do not have any usage of the `IAlbumTrack` interface, but we still expose the associated header (and the `AlbumTrackPtr` helper type)
Those are now useless and need to be removedFollowing #379 we do not have any usage of the `IAlbumTrack` interface, but we still expose the associated header (and the `AlbumTrackPtr` helper type)
Those are now useless and need to be removed0.11.xMehdi SabwatMehdi Sabwathttps://code.videolan.org/videolan/medialibrary/-/issues/390RTSP stream with question mark fails on VLC Mobile2021-11-15T16:46:13ZMark BiesmaRTSP stream with question mark fails on VLC MobileUsing the following RTSP stream on a Windows computer with VLC v3.0.14 works fine:
`rtsp://admin:password@192.168.1.112:554/cam/realmonitor?channel=1&subtype=0`
But when using the same RTSP stream on VLC Mobile (VLC for iOS v3.2.13) it...Using the following RTSP stream on a Windows computer with VLC v3.0.14 works fine:
`rtsp://admin:password@192.168.1.112:554/cam/realmonitor?channel=1&subtype=0`
But when using the same RTSP stream on VLC Mobile (VLC for iOS v3.2.13) it fails to start the stream.
I think it has something to do with the question mark in the RTSP stream URL.Felix Paul Kühnefkuehne@videolan.orgFelix Paul Kühnefkuehne@videolan.orghttps://code.videolan.org/videolan/medialibrary/-/issues/389Remove mandated MR milestone2021-11-26T16:42:16ZHugo Beauzée-LuyssenRemove mandated MR milestoneIt seems that people without the developer rank can't assign a milestone to a MR, which means all new MR pipelines will fail until someone with access assigns a milestone.
This probably requires to rethink a bit the automated benchmarki...It seems that people without the developer rank can't assign a milestone to a MR, which means all new MR pipelines will fail until someone with access assigns a milestone.
This probably requires to rethink a bit the automated benchmarking, but maybe it would only be a manual/nightly job given that the current machine load makes the results inconclusive0.11.xHugo Beauzée-LuyssenHugo Beauzée-Luyssenhttps://code.videolan.org/videolan/medialibrary/-/issues/388Add an isNew accessor for media2023-12-20T13:38:03ZHugo Beauzée-LuyssenAdd an isNew accessor for mediaWhich can be used by various port to signal that the media has never been read.
This just needs to be a convenience wrapper that checks for a 0 play count and that the media isn't in progressWhich can be used by various port to signal that the media has never been read.
This just needs to be a convenience wrapper that checks for a 0 play count and that the media isn't in progressMehdi SabwatMehdi Sabwathttps://code.videolan.org/videolan/medialibrary/-/issues/387Emit modification callbacks when modifying an entity thumbnail2021-11-16T20:05:19ZHugo Beauzée-LuyssenEmit modification callbacks when modifying an entity thumbnailSince modification callbacks are based on SQLite hooks, we don't emit those when a thumbnail gets modified, which is counter intuitive for medialib users.
We could emit those callbacks manually.Since modification callbacks are based on SQLite hooks, we don't emit those when a thumbnail gets modified, which is counter intuitive for medialib users.
We could emit those callbacks manually.0.11.xMehdi SabwatMehdi Sabwathttps://code.videolan.org/videolan/medialibrary/-/issues/383Add missing indexes to the Album table2021-11-09T15:30:48ZHugo Beauzée-LuyssenAdd missing indexes to the Album tableThe number of tracks (at least) is not indexed, yet we can use it to sort.
A local benchmark shows that indexing that field leads to a valuable gain when fetching albums sorted by their number of tracks, but ideally I'd like this to be ...The number of tracks (at least) is not indexed, yet we can use it to sort.
A local benchmark shows that indexing that field leads to a valuable gain when fetching albums sorted by their number of tracks, but ideally I'd like this to be confirmed by some automated benchmarking in the CI... That might be tight for 0.11 but it not, just indexing will be enough0.11.xHugo Beauzée-LuyssenHugo Beauzée-Luyssenhttps://code.videolan.org/videolan/medialibrary/-/issues/382Mesure the performance impact of precalculated counters2021-11-03T13:44:06ZHugo Beauzée-LuyssenMesure the performance impact of precalculated countersIn order to chose a solution for #373 we need to know if precalculating most counters makes a real performance difference.
My intuition would be that it makes the insertion a bit more costly (maybe even quite a bit given the number of t...In order to chose a solution for #373 we need to know if precalculating most counters makes a real performance difference.
My intuition would be that it makes the insertion a bit more costly (maybe even quite a bit given the number of triggers), but this is amortized once the initial scan is complete.
AFAICS we need to:
- [ ] Select a trigger to evaluate (in order to avoid writing the equivalent requests for all counters)
- [ ] Mesure the impact at insertion
- [ ] Mesure the impact when reading0.11.xHugo Beauzée-LuyssenHugo Beauzée-Luyssenhttps://code.videolan.org/videolan/medialibrary/-/issues/381Remove Media::save() member function2021-10-19T16:01:18ZHugo Beauzée-LuyssenRemove Media::save() member functionThis was introduced as an attempt to avoid multiple requests when updating multiple fields of a media, however all the valuable call sites (ie. not in tests) are enclosed in a transaction.
Having to manually invoke save() is incovenient...This was introduced as an attempt to avoid multiple requests when updating multiple fields of a media, however all the valuable call sites (ie. not in tests) are enclosed in a transaction.
Having to manually invoke save() is incovenient, and also mean that we might update some fields explicitly from the code, but have the database not updated, causing potential triggers or later calls to rely on an inconsistent state.0.11.xHugo Beauzée-LuyssenHugo Beauzée-Luyssenhttps://code.videolan.org/videolan/medialibrary/-/issues/371Album art doesn't show correctly when indexing some music tracks2021-09-29T16:08:58ZGhost UserAlbum art doesn't show correctly when indexing some music tracksIt only happens sometimes and doesn't crash VLC if I press ignore. A maybe related issue is that some of the album art is complete blank not even showing the default one. Playing the audio file in the album and on the track list gets dis...It only happens sometimes and doesn't crash VLC if I press ignore. A maybe related issue is that some of the album art is complete blank not even showing the default one. Playing the audio file in the album and on the track list gets displayed fine.
![image](/uploads/8ede671aca8383735a7a3ff9b9c720ae/image.png)
![image](/uploads/b54637764716a39c4692972bb650e9bc/image.png)
Versions: <br>
VLC: 27th September 2021 nightly build <br>
-OS: Windows 10.0.19043.1237 <br>Hugo Beauzée-LuyssenHugo Beauzée-Luyssenhttps://code.videolan.org/videolan/medialibrary/-/issues/370Search will display results for all files on system not in media library's only2021-09-29T12:57:15ZGhost UserSearch will display results for all files on system not in media library's onlyI have removed all library's and deleted the cache folder. VLC will display nothing as it should but then searching will bring up files from all over my system. This should not happen and should display nothing.
Versions: <br>
VLC: 27th...I have removed all library's and deleted the cache folder. VLC will display nothing as it should but then searching will bring up files from all over my system. This should not happen and should display nothing.
Versions: <br>
VLC: 27th September 2021 nightly build <br>
-OS: Windows 10.0.19043.1237 <br>Hugo Beauzée-LuyssenHugo Beauzée-Luyssenhttps://code.videolan.org/videolan/medialibrary/-/issues/369API change request: have a time return value for setLastTime2021-10-19T15:19:04ZNicolas PomepuyAPI change request: have a time return value for setLastTimeFollowing #354, we removed all the processing done in the Android app regarding the media time update. See https://code.videolan.org/videolan/vlc-android/-/commit/0a84d7f0e401621ab0fd3b796f9bf21f4dcc13ce#520b1c3c06d7ac7efd500fc4dd8e920ff...Following #354, we removed all the processing done in the Android app regarding the media time update. See https://code.videolan.org/videolan/vlc-android/-/commit/0a84d7f0e401621ab0fd3b796f9bf21f4dcc13ce#520b1c3c06d7ac7efd500fc4dd8e920ffbbbd491_472_474
Issue:
When saving a media time using `IMedia::setLastTime`, there is no way to get the new (medialibrary processed) time without re-querying this media just after that. Even if it works, it's far from being optimized.
Request:
Get a new `IMedia::setAndGetLastTime` returning the actual value saved in the DB. This way we can locally store the new time without having to do a new query to the ML.0.10.xHugo Beauzée-LuyssenHugo Beauzée-Luyssenhttps://code.videolan.org/videolan/medialibrary/-/issues/365FTBFS when using musl libc2021-09-02T08:09:33ZSean McGovernFTBFS when using musl libcThis was attempted from a Alpine Linux Docker image
Snipped for brevity:
```
[1/3] Compiling C++ object src/libmedialibrary.a.p/LockFile.cpp.o
ninja: job failed: g++ -Isrc/libmedialibrary.a.p -Isrc -I../src -I. -I.. -Iinclude -I../inclu...This was attempted from a Alpine Linux Docker image
Snipped for brevity:
```
[1/3] Compiling C++ object src/libmedialibrary.a.p/LockFile.cpp.o
ninja: job failed: g++ -Isrc/libmedialibrary.a.p -Isrc -I../src -I. -I.. -Iinclude -I../include -I/home/videolan/vlc/contrib/x86_64-alpine-linux-musl/include -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -Wextra -std=c++14 -O2 -g -DHAVE_CONFIG_H=1 -fPIC -pthread -MD -MQ src/libmedialibrary.a.p/LockFile.cpp.o -MF src/libmedialibrary.a.p/LockFile.cpp.o.d -o src/libmedialibrary.a.p/LockFile.cpp.o -c ../src/LockFile.cpp
../src/LockFile.cpp: In static member function 'static std::unique_ptr<medialibrary::LockFile> medialibrary::LockFile::lock(const string&)':
../src/LockFile.cpp:57:16: error: '::open' has not been declared; did you mean 'popen'?
57 | handle = ::open( lockFile.c_str(), O_RDWR | O_CREAT, S_IRUSR | S_IWUSR );
| ^~~~
| popen
../src/LockFile.cpp:57:40: error: 'O_RDWR' was not declared in this scope
57 | handle = ::open( lockFile.c_str(), O_RDWR | O_CREAT, S_IRUSR | S_IWUSR );
| ^~~~~~
../src/LockFile.cpp:57:49: error: 'O_CREAT' was not declared in this scope
57 | handle = ::open( lockFile.c_str(), O_RDWR | O_CREAT, S_IRUSR | S_IWUSR );
| ^~~~~~~
../src/LockFile.cpp:57:58: error: 'S_IRUSR' was not declared in this scope
57 | handle = ::open( lockFile.c_str(), O_RDWR | O_CREAT, S_IRUSR | S_IWUSR );
| ^~~~~~~
../src/LockFile.cpp:57:68: error: 'S_IWUSR' was not declared in this scope
57 | handle = ::open( lockFile.c_str(), O_RDWR | O_CREAT, S_IRUSR | S_IWUSR );
| ^~~~~~~
ninja: subcommand failed
```Hugo Beauzée-LuyssenHugo Beauzée-Luyssen