Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
medialibrary
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Duncan McNAMARA
medialibrary
Compare Revisions
0.3.x...master
Source
master
Select Git revision
...
Target
0.3.x
Select Git revision
Compare
Commits (967)
73e1439e
Media: Publicly allow thumbnail to be edited
Mar 20, 2018
fb005e17
metadata: Move startPlayback to a common code class helper
Mar 20, 2018
84ba019c
Metadata: Move playback fallback to the metadata extraction step
Mar 20, 2018
270da229
Metadata: Remove multiple pass parsing code.
Mar 20, 2018
0386e0b4
Metadata: Extract artwork attachment during the extraction phase
Mar 20, 2018
58fb5d56
Metadata: Simplify startPlayback
Mar 20, 2018
ffa5e52c
metadata: Common: Don't rely on parser types
Mar 20, 2018
2d97d88f
Metadata: Common: Remove useless scope
Mar 20, 2018
9ae0d60d
Use lazy loading for thumbnails
Mar 20, 2018
746f5d54
Tests: sample: Request a thumbnail to be generated before checking its presence
Mar 20, 2018
6ad74b0e
Makefile.am: Fix make distcheck
Mar 20, 2018
25826edd
MediaLibrary: Add missing override qualifier
Mar 28, 2018
bf4adfb7
Task: Fix completion detection
Mar 28, 2018
07c87aeb
AlbumTrack: Fix is_track_present trigger
Mar 28, 2018
445e58d7
Add a Thumbnail class
Mar 28, 2018
99a12d8c
Media: Use the new separated Thumbnail table
Mar 28, 2018
acb6c62b
MediaLibrary: Fixup a defective trigger during 12 to 13 migration
Mar 28, 2018
0904c5c7
test: Add missing v12 test database
Mar 28, 2018
05d12ed9
Split trigger fixup in model 13. Use model 14 for thumbnail changes
Mar 28, 2018
341d4de4
Fix make distcheck
Mar 28, 2018
8401a2c7
Thumbnail: Add a helper to set the mrl with its primary key.
Mar 28, 2018
9a8d73ca
Media: Don't cache a nullptr thumbnail if we failed to fetch it
Mar 29, 2018
c09ff6df
Thumbnail: Provide an empty MRL helper
Mar 29, 2018
a839bc18
unittest: Add a way to count triggers for migration tests
Mar 29, 2018
4f6ec86d
Album: Use external thumbnail table to store artworks
Mar 29, 2018
86963ad8
Artist: Use external thumbnail table to store artworks
Mar 29, 2018
3c9ce59e
Thumbnail: Rename setMrl to update
Mar 29, 2018
e6306f36
Specify thumbnail origins when setting those
Mar 29, 2018
2f8837e6
Album: Provide a getter for the associated thumbnail object
Mar 29, 2018
9bc6e16a
Artist: Add a getter for the associated thumbnail object
Mar 29, 2018
b1b0adad
MetadataParser: Don't check for nullptr album
Mar 29, 2018
9fd5407b
Media: Add missing override qualifier
Mar 29, 2018
204ce378
MetadataParser: Artist: Favor thumbnails of AlbumArtist
Mar 29, 2018
9f87a32a
MediaLibrary: Create the Thumbnail table early
Mar 29, 2018
30c7bf0c
MediaLibrary: Add missing bits to the model 12 to 13 migration
Mar 30, 2018
b56b876d
Media: Add sort by filename
Apr 11, 2018
514c8ab2
IMediaLibrary: Clarify forceRescan() doc
Apr 13, 2018
c8517b13
Artist: Split sort request suffix generation in a separate method
Apr 13, 2018
53e1a520
Artist: Allow search results to be sorted
Apr 13, 2018
597865bf
Media: Don't include absent files in search results
Apr 13, 2018
f38fca0c
Media: Use the same request for all type of sorts
Apr 13, 2018
aa1fc950
Media: Split sorting request generation in a separate function
Apr 13, 2018
2dfecbf9
Media: Join search results with the associated main file
Apr 20, 2018
3391641e
Media: Allow search results to be sorted
Apr 20, 2018
ce39d70d
Album: Ensure Album table is always aliased as alb
Apr 20, 2018
9d17df61
Album: Add sort by number of tracks
Apr 20, 2018
7abc3677
Album: Allow sort results to be sorted
Apr 20, 2018
fc32781d
Playlist: Split out sorting code
Apr 20, 2018
5bdf7d1c
Playlist: Allow search results to be sorted
Apr 20, 2018
0bbb7ae0
MediaLibrary: Allow aggregate searches to be sorted
Apr 20, 2018
841f5248
MediaLibrary: Add missing default parameter
Apr 20, 2018
5490770e
SqliteTools: Store the request index as a signed integer
Apr 23, 2018
79583945
Bump libvlcpp submodule
May 29, 2018
3931dc44
SqliteTraits: Add support for tuples
May 30, 2018
e9e5d6b8
Add a pagination API
May 30, 2018
486900fd
sqlite: Add support for pagination
May 30, 2018
9ecfc564
Media: Ensure subType isn't null
May 30, 2018
617831ae
unittests: Media: Add missing media save
May 30, 2018
d47769e6
Media: Filter media subtypes as part of the SQL request
May 30, 2018
2f6cf433
AlbumTrack: Remove unused member function declaration
May 30, 2018
5cf768d4
Add request pagination support
May 30, 2018
d576752c
Rename some old files() functions to media()
May 30, 2018
83470664
MetadataParser: Use video embedded covers if any
May 30, 2018
73ebfd36
parser: Split parser service specific bits in a separate header
May 30, 2018
b2ebe032
Makefile.am: Remove public headers from noinst list
May 30, 2018
69a830d1
ParserService: Remove unused member function
May 30, 2018
3807a79f
parser: Move service specific variables to the service implementations
May 30, 2018
a709a981
ParserService: Remove useless scope
May 30, 2018
ac63e93d
parser: Split restart/flush handling out of ParserService
May 30, 2018
83f3c95c
parser: Split out services and worker code
May 30, 2018
e01dcce9
parser: Rename old ParserService to ParserWorker
May 30, 2018
b0e63770
parser: Don't ignore initialization failures
May 30, 2018
082216a3
Parser: remove use of make_unique
May 31, 2018
1cc9bf33
Task: Store metadata out of VLC media
May 31, 2018
85c191ec
Task: Introduce an Item subclass
May 31, 2018
594810da
Task: Store the mrl in the item
May 31, 2018
b38d6e79
parser: Store subitems in the parent item
May 31, 2018
92be3f0c
parser: Store duration in the task item
May 31, 2018
53f03742
parser: Store the tracks in the track item
May 31, 2018
460a0112
VLCMetadataService: Use a local VLC::Media to extract metadata
May 31, 2018
ffac1f65
Task: Drop dependency on VLC
May 31, 2018
e6408963
Task: Store the media in the item
May 31, 2018
3fa529c9
Task: Add missing include
May 31, 2018
15418ed1
Task: Don't silently override the current item.
May 31, 2018
e55ea5c2
MetadataParser: Add missing virtual
May 31, 2018
f33a36f6
Task: Move all item specific instances in the item
Jun 01, 2018
91d4c039
MetadataParser: Simplify
Jun 01, 2018
5ebc44bf
parser: Item: Remove playlist index setter
Jun 01, 2018
0a259635
MetadataParser: Don't use a const shared_ptr&
Jun 01, 2018
311baf32
MetadataParser: Cosmetics
Jun 01, 2018
a4eb2191
Task: Simplify restoreLinkedEntities
Jun 01, 2018
dfaa6bed
parser: Item: Remove now unused setters
Jun 01, 2018
d79f0485
parser: Item: Rework subitems creation
Jun 01, 2018
3ed4e89f
MetadataParser: Don't invoke a static method through an instance
Jun 01, 2018
c6ba8ad5
MetadataParser: Properly handle playlist rescan
Jun 01, 2018
95f68025
Item: Channel the file changes back to the Task
Jun 01, 2018
6be2b1cc
Playlist: Remove unused wrapper method
Jun 01, 2018
8b04a6d1
Playlist: Remove now unused constructor
Jun 01, 2018
b2ecc662
Playlist: Remove trailing backslash
Jun 01, 2018
cbfb9657
Task: Fix clang build
Jun 01, 2018
867 additional commits have been omitted to prevent performance issues.
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
279 changed files
with
21062 additions
and
5899 deletions
+21062
-5899
.gitlab-ci.yml
.gitlab-ci.yml
+89
-0
Makefile.am
Makefile.am
+154
-77
configure.ac
configure.ac
+44
-63
include/Fixup.h
include/Fixup.h
+2
-2
include/Types.h
include/Types.h
+2
-2
include/discoverer/IDiscoverer.h
include/discoverer/IDiscoverer.h
+10
-10
include/medialibrary/IAlbum.h
include/medialibrary/IAlbum.h
+33
-9
include/medialibrary/IAlbumTrack.h
include/medialibrary/IAlbumTrack.h
+6
-4
include/medialibrary/IArtist.h
include/medialibrary/IArtist.h
+29
-6
include/medialibrary/IAudioTrack.h
include/medialibrary/IAudioTrack.h
+15
-18
include/medialibrary/IBookmark.h
include/medialibrary/IBookmark.h
+71
-0
include/medialibrary/IChapter.h
include/medialibrary/IChapter.h
+49
-0
include/medialibrary/IDeviceLister.h
include/medialibrary/IDeviceLister.h
+14
-6
include/medialibrary/IFile.h
include/medialibrary/IFile.h
+33
-2
include/medialibrary/IFolder.h
include/medialibrary/IFolder.h
+74
-6
include/medialibrary/IGenre.h
include/medialibrary/IGenre.h
+28
-7
include/medialibrary/IInterruptProbe.h
include/medialibrary/IInterruptProbe.h
+5
-15
include/medialibrary/ILabel.h
include/medialibrary/ILabel.h
+8
-9
include/medialibrary/ILogger.h
include/medialibrary/ILogger.h
+3
-4
include/medialibrary/IMedia.h
include/medialibrary/IMedia.h
+190
-22
include/medialibrary/IMediaLibrary.h
include/medialibrary/IMediaLibrary.h
+419
-205
include/medialibrary/IMetadata.h
include/medialibrary/IMetadata.h
+12
-12
include/medialibrary/IMovie.h
include/medialibrary/IMovie.h
+2
-5
include/medialibrary/IPlaylist.h
include/medialibrary/IPlaylist.h
+71
-22
include/medialibrary/IQuery.h
include/medialibrary/IQuery.h
+62
-0
include/medialibrary/IShow.h
include/medialibrary/IShow.h
+9
-5
include/medialibrary/IShowEpisode.h
include/medialibrary/IShowEpisode.h
+2
-5
include/medialibrary/ISubtitleTrack.h
include/medialibrary/ISubtitleTrack.h
+41
-0
include/medialibrary/IThumbnailer.h
include/medialibrary/IThumbnailer.h
+56
-0
include/medialibrary/IVideoTrack.h
include/medialibrary/IVideoTrack.h
+17
-15
include/medialibrary/Types.h
include/medialibrary/Types.h
+18
-4
include/medialibrary/filesystem/IDevice.h
include/medialibrary/filesystem/IDevice.h
+90
-0
include/medialibrary/filesystem/IDirectory.h
include/medialibrary/filesystem/IDirectory.h
+8
-2
include/medialibrary/filesystem/IFile.h
include/medialibrary/filesystem/IFile.h
+4
-3
include/medialibrary/filesystem/IFileSystemFactory.h
include/medialibrary/filesystem/IFileSystemFactory.h
+154
-0
include/medialibrary/parser/IItem.h
include/medialibrary/parser/IItem.h
+230
-0
include/medialibrary/parser/IParserService.h
include/medialibrary/parser/IParserService.h
+97
-0
include/medialibrary/parser/Parser.h
include/medialibrary/parser/Parser.h
+72
-0
libvlcpp
libvlcpp
+1
-1
m4/stdcxx_14.m4
m4/stdcxx_14.m4
+63
-38
medialibrary.pc.in
medialibrary.pc.in
+2
-2
src/Album.cpp
src/Album.cpp
+384
-183
src/Album.h
src/Album.h
+60
-37
src/AlbumTrack.cpp
src/AlbumTrack.cpp
+75
-98
src/AlbumTrack.h
src/AlbumTrack.h
+25
-31
src/Artist.cpp
src/Artist.cpp
+270
-121
src/Artist.h
src/Artist.h
+77
-25
src/AudioTrack.cpp
src/AudioTrack.cpp
+26
-19
src/AudioTrack.h
src/AudioTrack.h
+18
-21
src/Bookmark.cpp
src/Bookmark.cpp
+188
-0
src/Bookmark.h
src/Bookmark.h
+70
-0
src/Chapter.cpp
src/Chapter.cpp
+138
-0
src/Chapter.h
src/Chapter.h
+68
-0
src/Device.cpp
src/Device.cpp
+92
-26
src/Device.h
src/Device.h
+26
-17
src/Factory.cpp
src/Factory.cpp
+12
-3
src/File.cpp
src/File.cpp
+175
-89
src/File.h
src/File.h
+36
-27
src/Folder.cpp
src/Folder.cpp
+358
-124
src/Folder.h
src/Folder.h
+44
-24
src/Genre.cpp
src/Genre.cpp
+91
-57
src/Genre.h
src/Genre.h
+24
-20
src/History.cpp
src/History.cpp
+0
-108
src/Label.cpp
src/Label.cpp
+15
-13
src/Label.h
src/Label.h
+13
-21
src/Media.cpp
src/Media.cpp
+814
-284
src/Media.h
src/Media.h
+129
-66
src/MediaLibrary.cpp
src/MediaLibrary.cpp
+1104
-356
src/MediaLibrary.h
src/MediaLibrary.h
+244
-160
src/Metadata.cpp
src/Metadata.cpp
+220
-0
src/Metadata.h
src/Metadata.h
+93
-0
src/Movie.cpp
src/Movie.cpp
+23
-53
src/Movie.h
src/Movie.h
+13
-23
src/Playlist.cpp
src/Playlist.cpp
+265
-144
src/Playlist.h
src/Playlist.h
+36
-26
src/Settings.cpp
src/Settings.cpp
+5
-4
src/Settings.h
src/Settings.h
+2
-2
src/Show.cpp
src/Show.cpp
+130
-29
src/Show.h
src/Show.h
+29
-21
src/ShowEpisode.cpp
src/ShowEpisode.cpp
+30
-58
src/ShowEpisode.h
src/ShowEpisode.h
+15
-25
src/SubtitleTrack.cpp
src/SubtitleTrack.cpp
+127
-0
src/SubtitleTrack.h
src/SubtitleTrack.h
+63
-0
src/Thumbnail.cpp
src/Thumbnail.cpp
+386
-0
src/Thumbnail.h
src/Thumbnail.h
+217
-0
src/VideoTrack.cpp
src/VideoTrack.cpp
+81
-28
src/VideoTrack.h
src/VideoTrack.h
+37
-25
src/compat/ConditionVariable.h
src/compat/ConditionVariable.h
+3
-3
src/compat/Mutex.h
src/compat/Mutex.h
+2
-2
src/compat/Thread.h
src/compat/Thread.h
+2
-2
src/database/DatabaseHelpers.h
src/database/DatabaseHelpers.h
+14
-164
src/database/SqliteConnection.cpp
src/database/SqliteConnection.cpp
+26
-28
src/database/SqliteConnection.h
src/database/SqliteConnection.h
+5
-4
src/database/SqliteErrors.h
src/database/SqliteErrors.h
+594
-15
src/database/SqliteQuery.h
src/database/SqliteQuery.h
+196
-0
src/database/SqliteTools.cpp
src/database/SqliteTools.cpp
+24
-2
src/database/SqliteTools.h
src/database/SqliteTools.h
+58
-23
src/database/SqliteTraits.h
src/database/SqliteTraits.h
+136
-3
src/database/SqliteTransaction.cpp
src/database/SqliteTransaction.cpp
+4
-4
src/database/SqliteTransaction.h
src/database/SqliteTransaction.h
+2
-2
src/database/migrations/migration13-14.sql
src/database/migrations/migration13-14.sql
+251
-0
src/database/migrations/migration14-15.sql
src/database/migrations/migration14-15.sql
+30
-0
src/database/migrations/migration15-16.sql
src/database/migrations/migration15-16.sql
+29
-0
src/database/migrations/migration16-17.sql
src/database/migrations/migration16-17.sql
+116
-0
src/database/migrations/migration17-18.sql
src/database/migrations/migration17-18.sql
+47
-0
src/database/migrations/migration18-19.sql
src/database/migrations/migration18-19.sql
+30
-0
src/database/migrations/migration3-5.sql
src/database/migrations/migration3-5.sql
+20
-20
src/database/migrations/migration7-8.sql
src/database/migrations/migration7-8.sql
+27
-25
src/database/tables/Album_v16.sql
src/database/tables/Album_v16.sql
+27
-0
src/database/tables/Album_v17.sql
src/database/tables/Album_v17.sql
+24
-0
src/database/tables/Artist_v16.sql
src/database/tables/Artist_v16.sql
+39
-0
src/database/tables/Artist_v17.sql
src/database/tables/Artist_v17.sql
+36
-0
src/database/tables/Bookmark_v17.sql
src/database/tables/Bookmark_v17.sql
+12
-0
src/database/tables/Device_v14.sql
src/database/tables/Device_v14.sql
+9
-0
src/database/tables/File_triggers_v14.sql
src/database/tables/File_triggers_v14.sql
+5
-0
src/database/tables/File_v14.sql
src/database/tables/File_v14.sql
+25
-0
src/database/tables/Folder_triggers_v14.sql
src/database/tables/Folder_triggers_v14.sql
+19
-0
src/database/tables/Folder_triggers_v15.sql
src/database/tables/Folder_triggers_v15.sql
+18
-0
src/database/tables/Folder_v14.sql
src/database/tables/Folder_v14.sql
+41
-0
src/database/tables/Folder_v15.sql
src/database/tables/Folder_v15.sql
+41
-0
src/database/tables/Folder_v16.sql
src/database/tables/Folder_v16.sql
+35
-0
src/database/tables/Media_triggers_v14.sql
src/database/tables/Media_triggers_v14.sql
+40
-0
src/database/tables/Media_v14.sql
src/database/tables/Media_v14.sql
+35
-0
src/database/tables/Media_v17.sql
src/database/tables/Media_v17.sql
+32
-0
src/database/tables/Metadata_v14.sql
src/database/tables/Metadata_v14.sql
+8
-0
src/database/tables/Playlist_triggers_v14.sql
src/database/tables/Playlist_triggers_v14.sql
+46
-0
src/database/tables/Playlist_triggers_v16.sql
src/database/tables/Playlist_triggers_v16.sql
+35
-0
src/database/tables/Playlist_v14.sql
src/database/tables/Playlist_v14.sql
+29
-0
src/database/tables/Playlist_v16.sql
src/database/tables/Playlist_v16.sql
+29
-0
src/database/tables/Task_triggers_v18.sql
src/database/tables/Task_triggers_v18.sql
+12
-0
src/database/tables/Task_v14.sql
src/database/tables/Task_v14.sql
+20
-0
src/database/tables/Task_v18.sql
src/database/tables/Task_v18.sql
+23
-0
src/database/tables/Thumbnail_triggers_v17.sql
src/database/tables/Thumbnail_triggers_v17.sql
+47
-0
src/database/tables/Thumbnail_triggers_v18.sql
src/database/tables/Thumbnail_triggers_v18.sql
+68
-0
src/database/tables/Thumbnail_v16.sql
src/database/tables/Thumbnail_v16.sql
+7
-0
src/database/tables/Thumbnail_v17.sql
src/database/tables/Thumbnail_v17.sql
+22
-0
src/database/tables/Thumbnail_v18.sql
src/database/tables/Thumbnail_v18.sql
+23
-0
src/discoverer/DiscovererWorker.cpp
src/discoverer/DiscovererWorker.cpp
+78
-14
src/discoverer/DiscovererWorker.h
src/discoverer/DiscovererWorker.h
+14
-3
src/discoverer/FsDiscoverer.cpp
src/discoverer/FsDiscoverer.cpp
+146
-113
src/discoverer/FsDiscoverer.h
src/discoverer/FsDiscoverer.h
+18
-12
src/discoverer/probe/CrawlerProbe.h
src/discoverer/probe/CrawlerProbe.h
+4
-4
src/discoverer/probe/IProbe.h
src/discoverer/probe/IProbe.h
+3
-3
src/discoverer/probe/PathProbe.cpp
src/discoverer/probe/PathProbe.cpp
+27
-16
src/discoverer/probe/PathProbe.h
src/discoverer/probe/PathProbe.h
+9
-9
src/factory/DeviceListerFactory.cpp
src/factory/DeviceListerFactory.cpp
+2
-2
src/factory/DeviceListerFactory.h
src/factory/DeviceListerFactory.h
+2
-2
src/factory/FileSystemFactory.cpp
src/factory/FileSystemFactory.cpp
+70
-30
src/factory/FileSystemFactory.h
src/factory/FileSystemFactory.h
+28
-23
src/factory/NetworkFileSystemFactory.cpp
src/factory/NetworkFileSystemFactory.cpp
+90
-39
src/factory/NetworkFileSystemFactory.h
src/factory/NetworkFileSystemFactory.h
+16
-9
src/filesystem/common/CommonDevice.cpp
src/filesystem/common/CommonDevice.cpp
+44
-9
src/filesystem/common/CommonDevice.h
src/filesystem/common/CommonDevice.h
+11
-6
src/filesystem/common/CommonDirectory.cpp
src/filesystem/common/CommonDirectory.cpp
+24
-13
src/filesystem/common/CommonDirectory.h
src/filesystem/common/CommonDirectory.h
+9
-9
src/filesystem/common/CommonFile.cpp
src/filesystem/common/CommonFile.cpp
+7
-2
src/filesystem/common/CommonFile.h
src/filesystem/common/CommonFile.h
+4
-3
src/filesystem/darwin/DeviceLister.h
src/filesystem/darwin/DeviceLister.h
+1
-1
src/filesystem/network/Device.cpp
src/filesystem/network/Device.cpp
+6
-2
src/filesystem/network/Device.h
src/filesystem/network/Device.h
+2
-2
src/filesystem/network/Directory.cpp
src/filesystem/network/Directory.cpp
+22
-13
src/filesystem/network/Directory.h
src/filesystem/network/Directory.h
+5
-3
src/filesystem/network/File.cpp
src/filesystem/network/File.cpp
+11
-2
src/filesystem/network/File.h
src/filesystem/network/File.h
+3
-2
src/filesystem/unix/Device.h
src/filesystem/unix/Device.h
+2
-2
src/filesystem/unix/DeviceLister.cpp
src/filesystem/unix/DeviceLister.cpp
+45
-44
src/filesystem/unix/DeviceLister.h
src/filesystem/unix/DeviceLister.h
+5
-5
src/filesystem/unix/Directory.cpp
src/filesystem/unix/Directory.cpp
+6
-15
src/filesystem/unix/Directory.h
src/filesystem/unix/Directory.h
+3
-4
src/filesystem/unix/File.cpp
src/filesystem/unix/File.cpp
+2
-2
src/filesystem/unix/File.h
src/filesystem/unix/File.h
+2
-2
src/filesystem/win32/Device.h
src/filesystem/win32/Device.h
+2
-2
src/filesystem/win32/DeviceLister.cpp
src/filesystem/win32/DeviceLister.cpp
+11
-9
src/filesystem/win32/DeviceLister.h
src/filesystem/win32/DeviceLister.h
+2
-2
src/filesystem/win32/Directory.cpp
src/filesystem/win32/Directory.cpp
+34
-28
src/filesystem/win32/Directory.h
src/filesystem/win32/Directory.h
+3
-4
src/filesystem/win32/File.cpp
src/filesystem/win32/File.cpp
+3
-4
src/filesystem/win32/File.h
src/filesystem/win32/File.h
+2
-2
src/logging/IostreamLogger.cpp
src/logging/IostreamLogger.cpp
+2
-2
src/logging/IostreamLogger.h
src/logging/IostreamLogger.h
+11
-6
src/logging/Logger.cpp
src/logging/Logger.cpp
+2
-2
src/logging/Logger.h
src/logging/Logger.h
+15
-5
src/metadata_services/LinkService.cpp
src/metadata_services/LinkService.cpp
+101
-0
src/metadata_services/LinkService.h
src/metadata_services/LinkService.h
+52
-0
src/metadata_services/MetadataParser.cpp
src/metadata_services/MetadataParser.cpp
+708
-307
src/metadata_services/MetadataParser.h
src/metadata_services/MetadataParser.h
+44
-22
src/metadata_services/vlc/Common.cpp
src/metadata_services/vlc/Common.cpp
+112
-0
src/metadata_services/vlc/Common.hpp
src/metadata_services/vlc/Common.hpp
+40
-0
src/metadata_services/vlc/VLCMetadataService.cpp
src/metadata_services/vlc/VLCMetadataService.cpp
+144
-24
src/metadata_services/vlc/VLCMetadataService.h
src/metadata_services/vlc/VLCMetadataService.h
+23
-17
src/metadata_services/vlc/VLCThumbnailer.cpp
src/metadata_services/vlc/VLCThumbnailer.cpp
+0
-401
src/metadata_services/vlc/imagecompressors/EvasCompressor.cpp
...metadata_services/vlc/imagecompressors/EvasCompressor.cpp
+0
-122
src/parser/Parser.cpp
src/parser/Parser.cpp
+49
-35
src/parser/Parser.h
src/parser/Parser.h
+18
-13
src/parser/ParserWorker.cpp
src/parser/ParserWorker.cpp
+305
-0
src/parser/ParserWorker.h
src/parser/ParserWorker.h
+20
-26
src/parser/Task.cpp
src/parser/Task.cpp
+442
-135
src/parser/Task.h
src/parser/Task.h
+164
-66
src/thumbnails/CoreThumbnailer.cpp
src/thumbnails/CoreThumbnailer.cpp
+92
-0
src/thumbnails/CoreThumbnailer.h
src/thumbnails/CoreThumbnailer.h
+52
-0
src/thumbnails/ThumbnailerWorker.cpp
src/thumbnails/ThumbnailerWorker.cpp
+208
-0
src/thumbnails/ThumbnailerWorker.h
src/thumbnails/ThumbnailerWorker.h
+77
-0
src/thumbnails/VmemThumbnailer.cpp
src/thumbnails/VmemThumbnailer.cpp
+235
-0
src/thumbnails/VmemThumbnailer.h
src/thumbnails/VmemThumbnailer.h
+73
-0
src/thumbnails/imagecompressors/IImageCompressor.h
src/thumbnails/imagecompressors/IImageCompressor.h
+2
-2
src/thumbnails/imagecompressors/JpegCompressor.cpp
src/thumbnails/imagecompressors/JpegCompressor.cpp
+2
-2
src/thumbnails/imagecompressors/JpegCompressor.h
src/thumbnails/imagecompressors/JpegCompressor.h
+2
-2
src/utils/Charsets.h
src/utils/Charsets.h
+2
-2
src/utils/Directory.cpp
src/utils/Directory.cpp
+29
-2
src/utils/Directory.h
src/utils/Directory.h
+4
-3
src/utils/File.cpp
src/utils/File.cpp
+99
-0
src/utils/File.h
src/utils/File.h
+50
-0
src/utils/Filename.cpp
src/utils/Filename.cpp
+58
-63
src/utils/Filename.h
src/utils/Filename.h
+13
-11
src/utils/ModificationsNotifier.cpp
src/utils/ModificationsNotifier.cpp
+67
-26
src/utils/ModificationsNotifier.h
src/utils/ModificationsNotifier.h
+52
-20
src/utils/SWMRLock.h
src/utils/SWMRLock.h
+2
-2
src/utils/Strings.cpp
src/utils/Strings.cpp
+59
-0
src/utils/Strings.h
src/utils/Strings.h
+46
-0
src/utils/Url.cpp
src/utils/Url.cpp
+28
-4
src/utils/Url.h
src/utils/Url.h
+4
-2
src/utils/VLCInstance.cpp
src/utils/VLCInstance.cpp
+9
-5
src/utils/VLCInstance.h
src/utils/VLCInstance.h
+2
-2
test/common/MediaLibraryTester.cpp
test/common/MediaLibraryTester.cpp
+148
-37
test/common/MediaLibraryTester.h
test/common/MediaLibraryTester.h
+35
-16
test/discoverer/main.cpp
test/discoverer/main.cpp
+146
-0
test/mocks/DiscovererCbMock.h
test/mocks/DiscovererCbMock.h
+11
-4
test/mocks/FileSystem.cpp
test/mocks/FileSystem.cpp
+2
-2
test/mocks/FileSystem.h
test/mocks/FileSystem.h
+75
-13
test/mocks/MockDeviceLister.h
test/mocks/MockDeviceLister.h
+2
-2
test/mocks/NoopCallback.h
test/mocks/NoopCallback.h
+11
-7
test/mocks/filesystem/MockDevice.cpp
test/mocks/filesystem/MockDevice.cpp
+38
-17
test/mocks/filesystem/MockDevice.h
test/mocks/filesystem/MockDevice.h
+10
-5
test/mocks/filesystem/MockDirectory.cpp
test/mocks/filesystem/MockDirectory.cpp
+13
-6
test/mocks/filesystem/MockDirectory.h
test/mocks/filesystem/MockDirectory.h
+4
-4
test/mocks/filesystem/MockFile.cpp
test/mocks/filesystem/MockFile.cpp
+7
-2
test/mocks/filesystem/MockFile.h
test/mocks/filesystem/MockFile.h
+4
-3
test/samples/Tester.cpp
test/samples/Tester.cpp
+170
-34
test/samples/Tester.h
test/samples/Tester.h
+46
-7
test/samples/main.cpp
test/samples/main.cpp
+171
-47
test/samples/samples
test/samples/samples
+1
-1
test/samples/testcases/artwork_not_from_compilation.json
test/samples/testcases/artwork_not_from_compilation.json
+46
-0
test/samples/testcases/deduce_artwork_from_album.json
test/samples/testcases/deduce_artwork_from_album.json
+3
-0
test/samples/testcases/multi_cd.json
test/samples/testcases/multi_cd.json
+1
-0
test/samples/testcases/parse_video.json
test/samples/testcases/parse_video.json
+5
-1
test/samples/testcases/playlist_external_media.json
test/samples/testcases/playlist_external_media.json
+1
-1
test/sqlite_load/SqliteLoadTest.cpp
test/sqlite_load/SqliteLoadTest.cpp
+212
-0
test/unittest/AlbumTests.cpp
test/unittest/AlbumTests.cpp
+243
-68
test/unittest/AlbumTrackTests.cpp
test/unittest/AlbumTrackTests.cpp
+5
-45
test/unittest/ArtistTests.cpp
test/unittest/ArtistTests.cpp
+243
-71
test/unittest/AudioTrackTests.cpp
test/unittest/AudioTrackTests.cpp
+21
-5
test/unittest/BookmarkTests.cpp
test/unittest/BookmarkTests.cpp
+262
-0
test/unittest/ChapterTests.cpp
test/unittest/ChapterTests.cpp
+100
-0
test/unittest/DeviceTests.cpp
test/unittest/DeviceTests.cpp
+175
-33
test/unittest/FileTests.cpp
test/unittest/FileTests.cpp
+27
-3
test/unittest/FolderTests.cpp
test/unittest/FolderTests.cpp
+421
-56
test/unittest/FsUtilsTests.cpp
test/unittest/FsUtilsTests.cpp
+27
-8
test/unittest/GenreTests.cpp
test/unittest/GenreTests.cpp
+134
-45
test/unittest/LabelTests.cpp
test/unittest/LabelTests.cpp
+17
-16
test/unittest/MediaTests.cpp
test/unittest/MediaTests.cpp
+622
-94
test/unittest/MiscTests.cpp
test/unittest/MiscTests.cpp
+274
-12
test/unittest/MovieTests.cpp
test/unittest/MovieTests.cpp
+17
-30
test/unittest/PlaylistTests.cpp
test/unittest/PlaylistTests.cpp
+357
-46
test/unittest/RemovalNotifierTests.cpp
test/unittest/RemovalNotifierTests.cpp
+92
-25
test/unittest/ShowTests.cpp
test/unittest/ShowTests.cpp
+141
-47
test/unittest/SubtitleTrackTests.cpp
test/unittest/SubtitleTrackTests.cpp
+94
-0
test/unittest/Tests.cpp
test/unittest/Tests.cpp
+12
-21
test/unittest/Tests.h
test/unittest/Tests.h
+8
-6
test/unittest/ThumbnailTests.cpp
test/unittest/ThumbnailTests.cpp
+421
-0
test/unittest/UrlTests.cpp
test/unittest/UrlTests.cpp
+8
-2
test/unittest/VideoTrackTests.cpp
test/unittest/VideoTrackTests.cpp
+37
-9
test/unittest/db_v12.sql
test/unittest/db_v12.sql
+80
-0
test/unittest/db_v13.sql
test/unittest/db_v13.sql
+92
-0
test/unittest/db_v14.sql
test/unittest/db_v14.sql
+89
-0
test/unittest/db_v15.sql
test/unittest/db_v15.sql
+103
-0
test/unittest/db_v16.sql
test/unittest/db_v16.sql
+103
-0
test/unittest/db_v17.sql
test/unittest/db_v17.sql
+99
-0
test/unittest/db_v18_broken.sql
test/unittest/db_v18_broken.sql
+114
-0
test/unittest/db_v18_ok.sql
test/unittest/db_v18_ok.sql
+105
-0
No files found.
.gitlab-ci.yml
0 → 100644
View file @
c867021a
variables
:
GIT_SUBMODULE_STRATEGY
:
normal
linux
:
image
:
registry.videolan.org/medialibrary:20190531150343
tags
:
-
debian
-
amd64
script
:
-
./bootstrap
-
./configure --enable-tests
-
make -j4
-
make -j4 check
-
./unittest
-
./samples -vv
win32
:
image
:
registry.videolan.org/medialibrary-win32:20190625083440
tags
:
-
win32
script
:
-
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/prefix/lib/pkgconfig"
-
./bootstrap
-
./configure --enable-tests --host=i686-w64-mingw32 --disable-shared
-
make -j4
-
make -j4 check
-
cp /prefix/dll/libvlc.dll .
-
cp /prefix/dll/libvlccore.dll .
-
ln -s /prefix/lib/vlc/plugins/ .
-
wine unittest.exe
-
wine samples.exe -vv
win64
:
image
:
registry.videolan.org/medialibrary-win64:20190625085114
tags
:
-
win64
script
:
-
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/prefix/lib/pkgconfig"
-
./bootstrap
-
./configure --enable-tests --host=x86_64-w64-mingw32 --disable-shared
-
make -j4
-
make -j4 check
-
cp /prefix/dll/libvlc.dll .
-
cp /prefix/dll/libvlccore.dll .
-
ln -s /prefix/lib/vlc/plugins/ .
-
wine unittest.exe
-
wine samples.exe -vv
coverage
:
image
:
registry.videolan.org/medialibrary:20190531150343
tags
:
-
debian
-
amd64
only
:
refs
:
-
master
script
:
-
./bootstrap
-
CXXFLAGS='--coverage -g -O0' LDFLAGS='--coverage -g -O0' ./configure --enable-tests
-
make -j4 check
-
./unittest && ./samples
-
lcov --capture --directory . -o coverage.info
-
lcov --remove coverage.info "/usr/*" -o coverage.info
-
lcov --remove coverage.info "/prefix/*" -o coverage.info
-
lcov --remove coverage.info "$CI_PROJECT_DIR/test/*" -o coverage.info
-
lcov --remove coverage.info "$CI_PROJECT_DIR/googletest/*" -o coverage.info
-
lcov --remove coverage.info "$CI_PROJECT_DIR/src/logging/*" -o coverage.info
-
lcov --remove coverage.info "$CI_PROJECT_DIR/libvlcpp/*" -o coverage.info
-
lcov --summary coverage.info
-
genhtml coverage.info --output-directory html/
artifacts
:
name
:
"
coverage-medialibrary-$CI_COMMIT_SHORT_SHA"
paths
:
-
html/
asan-ubsan
:
image
:
registry.videolan.org/medialibrary:20190531150343
tags
:
-
debian
-
amd64
variables
:
LSAN_OPTIONS
:
'
detect_leaks=0'
script
:
-
./bootstrap
-
./configure --enable-tests CXXFLAGS="-g -O1 -fsanitize=address,undefined"
-
make -j4
-
make -j4 check
-
./unittest
-
./samples -vv
Makefile.am
View file @
c867021a
ACLOCAL_AMFLAGS
=
-I
m4
AM_C
PP
FLAGS
=
-Wall
-Wsign-compare
-Wextra
-Wstrict-aliasing
-Wstrict-overflow
\
AM_C
XX
FLAGS
=
-Wall
-Wsign-compare
-Wextra
-Wstrict-aliasing
-Wstrict-overflow
\
-Wformat
=
2
-Wno-unused-parameter
-Wcast-align
-Wpointer-arith
\
-Wwrite-strings
\
-pipe
...
...
@@ -9,12 +9,14 @@ MEDIALIB_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/include -I$(top_srcdir)/src
libmedialibrary_ladir
=
$(includedir)
/medialibrary
libmedialibrary_la_CXXFLAGS
=
\
$(AM_CXXFLAGS)
\
-fvisibility
=
default
\
$(NULL)
libmedialibrary_la_CPPFLAGS
=
\
$(MEDIALIB_CPPFLAGS)
\
$(SQLITE_CFLAGS)
\
$(VLC_CFLAGS)
\
$(VLCPP_CFLAGS)
\
-fvisibility
=
default
\
$(NULL)
libmedialibrary_la_HEADERS
=
\
...
...
@@ -22,9 +24,10 @@ libmedialibrary_la_HEADERS = \
include/medialibrary/IAlbumTrack.h
\
include/medialibrary/IArtist.h
\
include/medialibrary/IAudioTrack.h
\
include/medialibrary/IBookmark.h
\
include/medialibrary/IChapter.h
\
include/medialibrary/IFile.h
\
include/medialibrary/IGenre.h
\
include/medialibrary/IHistoryEntry.h
\
include/medialibrary/ILabel.h
\
include/medialibrary/ILogger.h
\
include/medialibrary/IMedia.h
\
...
...
@@ -37,6 +40,26 @@ libmedialibrary_la_HEADERS = \
include/medialibrary/Types.h
\
include/medialibrary/IDeviceLister.h
\
include/medialibrary/IFolder.h
\
include/medialibrary/IQuery.h
\
include/medialibrary/IMetadata.h
\
include/medialibrary/ISubtitleTrack.h
\
include/medialibrary/IThumbnailer.h
\
include/medialibrary/IInterruptProbe.h
\
$(NULL)
libmedialibraryfsdir
=
$(libmedialibrary_ladir)
/filesystem
libmedialibraryfs_HEADERS
=
\
include/medialibrary/filesystem/IDevice.h
\
include/medialibrary/filesystem/IDirectory.h
\
include/medialibrary/filesystem/IFile.h
\
include/medialibrary/filesystem/IFileSystemFactory.h
\
$(NULL)
libmedialibraryparserdir
=
$(libmedialibrary_ladir)
/parser
libmedialibraryparser_HEADERS
=
\
include/medialibrary/parser/IItem.h
\
include/medialibrary/parser/Parser.h
\
include/medialibrary/parser/IParserService.h
\
$(NULL)
libmedialibrary_la_SOURCES
=
\
...
...
@@ -47,9 +70,9 @@ libmedialibrary_la_SOURCES = \
src/Device.cpp
\
src/Factory.cpp
\
src/File.cpp
\
src/Chapter.cpp
\
src/Folder.cpp
\
src/Genre.cpp
\
src/History.cpp
\
src/Label.cpp
\
src/Media.cpp
\
src/MediaLibrary.cpp
\
...
...
@@ -57,8 +80,11 @@ libmedialibrary_la_SOURCES = \
src/Playlist.cpp
\
src/Settings.cpp
\
src/Show.cpp
\
src/Thumbnail.cpp
\
src/ShowEpisode.cpp
\
src/VideoTrack.cpp
\
src/Metadata.cpp
\
src/SubtitleTrack.cpp
\
src/database/SqliteConnection.cpp
\
src/database/SqliteTools.cpp
\
src/database/SqliteTransaction.cpp
\
...
...
@@ -66,53 +92,31 @@ libmedialibrary_la_SOURCES = \
src/discoverer/FsDiscoverer.cpp
\
src/discoverer/probe/PathProbe.cpp
\
src/factory/FileSystemFactory.cpp
\
src/factory/NetworkFileSystemFactory.cpp
\
src/factory/DeviceListerFactory.cpp
\
src/filesystem/common/CommonDevice.cpp
\
src/filesystem/common/CommonFile.cpp
\
src/filesystem/common/CommonDirectory.cpp
\
src/filesystem/network/Directory.cpp
\
src/filesystem/network/File.cpp
\
src/filesystem/network/Device.cpp
\
src/logging/IostreamLogger.cpp
\
src/logging/Logger.cpp
\
src/metadata_services/MetadataParser.cpp
\
src/metadata_services/
vlc/VLCMetadata
Service.cpp
\
src/
metadata_services/vlc/VLCThumbnail
er.cpp
\
src/metadata_services/
Link
Service.cpp
\
src/
thumbnails/ThumbnailerWork
er.cpp
\
src/parser/Parser.cpp
\
src/parser/Parser
Service
.cpp
\
src/parser/Parser
Worker
.cpp
\
src/parser/Task.cpp
\
src/utils/Directory.cpp
\
src/utils/Filename.cpp
\
src/utils/ModificationsNotifier.cpp
\
src/utils/Strings.cpp
\
src/utils/Url.cpp
\
src/utils/VLCInstance.cpp
\
src/utils/File.cpp
\
src/Bookmark.cpp
\
$(NULL)
noinst_HEADERS
=
\
include/discoverer/IDiscoverer.h
\
include/factory/IFileSystem.h
\
include/filesystem/IDevice.h
\
include/filesystem/IDirectory.h
\
include/filesystem/IFile.h
\
include/Fixup.h
\
include/medialibrary/IAlbum.h
\
include/medialibrary/IAlbumTrack.h
\
include/medialibrary/IArtist.h
\
include/medialibrary/IAudioTrack.h
\
include/medialibrary/IFile.h
\
include/medialibrary/IGenre.h
\
include/medialibrary/IHistoryEntry.h
\
include/medialibrary/ILabel.h
\
include/medialibrary/ILogger.h
\
include/medialibrary/IMedia.h
\
include/medialibrary/IMediaLibrary.h
\
include/medialibrary/IMovie.h
\
include/medialibrary/IPlaylist.h
\
include/medialibrary/IShowEpisode.h
\
include/medialibrary/IShow.h
\
include/medialibrary/IVideoTrack.h
\
include/medialibrary/Types.h
\
include/Types.h
\
src/Album.h
\
src/AlbumTrack.h
\
...
...
@@ -121,6 +125,7 @@ noinst_HEADERS = \
src/database/DatabaseHelpers.h
\
src/database/SqliteConnection.h
\
src/database/SqliteErrors.h
\
src/database/SqliteQuery.h
\
src/database/SqliteTools.h
\
src/database/SqliteTraits.h
\
src/database/SqliteTransaction.h
\
...
...
@@ -131,7 +136,6 @@ noinst_HEADERS = \
src/discoverer/probe/IProbe.h
\
src/discoverer/probe/PathProbe.h
\
src/factory/FileSystemFactory.h
\
src/factory/NetworkFileSystemFactory.h
\
src/factory/DeviceListerFactory.h
\
src/File.h
\
src/filesystem/common/CommonFile.h
\
...
...
@@ -141,43 +145,43 @@ noinst_HEADERS = \
src/filesystem/unix/Device.h
\
src/filesystem/unix/Directory.h
\
src/filesystem/unix/File.h
\
src/filesystem/network/Device.h
\
src/filesystem/network/Directory.h
\
src/filesystem/network/File.h
\
src/filesystem/unix/DeviceLister.h
\
src/filesystem/win32/Directory.h
\
src/filesystem/win32/File.h
\
src/Chapter.h
\
src/Folder.h
\
src/Genre.h
\
src/History.h
\
src/Label.h
\
src/logging/IostreamLogger.h
\
src/logging/Logger.h
\
src/Media.h
\
src/MediaLibrary.h
\
src/metadata_services/MetadataParser.h
\
src/metadata_services/vlc/VLCMetadataService.h
\
src/metadata_services/vlc/VLCThumbnailer.h
\
src/metadata_services/vlc/imagecompressors/IImageCompressor.h
\
src/metadata_services/LinkService.h
\
src/thumbnails/ThumbnailerWorker.h
\
src/Movie.h
\
src/parser/Parser.h
\
src/parser/Parser
Service
.h
\
src/parser/Parser
Worker
.h
\
src/parser/Task.h
\
src/Playlist.h
\
src/Settings.h
\
src/ShowEpisode.h
\
src/Show.h
\
src/
utils/Cache
.h
\
src/
Thumbnail
.h
\
src/utils/Directory.h
\
src/utils/Filename.h
\
src/utils/ModificationsNotifier.h
\
src/utils/Strings.h
\
src/utils/SWMRLock.h
\
src/utils/Url.h
\
src/utils/
VLCInstanc
e.h
\
src/utils/
Fil
e.h
\
src/VideoTrack.h
\
src/Metadata.h
\
src/compat/Thread.h
\
src/compat/Mutex.h
\
src/compat/ConditionVariable.h
\
src/SubtitleTrack.h
\
src/Bookmark.h
\
$(NULL)
...
...
@@ -212,7 +216,6 @@ endif
libmedialibrary_la_LIBADD
=
\
$(SQLITE_LIBS)
\
$(VLC_LIBS)
\
$(NULL)
libmedialibrary_la_LDFLAGS
=
-no-undefined
-export-symbols-regex
'NewMediaLibrary'
...
...
@@ -221,25 +224,63 @@ libmedialibrary_la_LIBADD += libmedialibrary_macos.la
libmedialibrary_la_LDFLAGS
+=
-Wl
,-undefined,dynamic_lookup,-framework,Foundation
endif
lib_LTLIBRARIES
=
libmedialibrary.la
if
HAVE_DARWIN
lib_LTLIBRARIES
+=
libmedialibrary_macos.la
endif
if
HAVE_LIBVLC
if
HAVE_LIBVLC4
libmedialibrary_la_SOURCES
+=
\
src/thumbnails/CoreThumbnailer.cpp
\
src/thumbnails/CoreThumbnailer.h
if
HAVE_EVAS
libmedialibrary_la_SOURCES
+=
src/metadata_services/vlc/imagecompressors/EvasCompressor.cpp
noinst_HEADERS
+=
src/metadata_services/vlc/imagecompressors/EvasCompressor.h
libmedialibrary_la_CPPFLAGS
+=
$(EVAS_CFLAGS)
else
libmedialibrary_la_SOURCES
+=
\
src/thumbnails/VmemThumbnailer.cpp
\
src/thumbnails/VmemThumbnailer.h
if
HAVE_LIBJPEG
libmedialibrary_la_SOURCES
+=
src/
metadata_services/vlc
/imagecompressors/JpegCompressor.cpp
noinst_HEADERS
+=
src/
metadata_services/vlc
/imagecompressors/JpegCompressor.h
libmedialibrary_la_SOURCES
+=
src/
thumbnails
/imagecompressors/JpegCompressor.cpp
noinst_HEADERS
+=
src/
thumbnails
/imagecompressors/JpegCompressor.h
libmedialibrary_la_CPPFLAGS
+=
$(LIBJPEG_CFLAGS)
libmedialibrary_la_LIBADD
+=
$(LIBJPEG_LIBS)
endif
endif
lib_LTLIBRARIES
=
libmedialibrary.la
if
HAVE_DARWIN
lib_LTLIBRARIES
+=
libmedialibrary_macos.la
libmedialibrary_la_SOURCES
+=
\
src/metadata_services/vlc/VLCMetadataService.cpp
\
src/metadata_services/vlc/Common.cpp
\
src/utils/VLCInstance.cpp
\
src/factory/NetworkFileSystemFactory.cpp
\
src/filesystem/network/Directory.cpp
\
src/filesystem/network/File.cpp
\
src/filesystem/network/Device.cpp
\
$(NULL)
noinst_HEADERS
+=
\
src/utils/VLCInstance.h
\
src/metadata_services/vlc/Common.hpp
\
src/metadata_services/vlc/VLCMetadataService.h
\
src/thumbnails/imagecompressors/IImageCompressor.h
\
src/factory/NetworkFileSystemFactory.h
\
src/filesystem/network/Device.h
\
src/filesystem/network/Directory.h
\
src/filesystem/network/File.h
\
$(NULL)
libmedialibrary_la_CPPFLAGS
+=
\
$(VLC_CFLAGS)
\
$(VLCPP_CFLAGS)
\
$(NULL)
libmedialibrary_la_LIBADD
+=
$(VLC_LIBS)
endif
EXTRA_DIST
=
if
HAVE_TESTS
...
...
@@ -255,20 +296,11 @@ libgtestmain_la_SOURCES = \
googletest/src/gtest_main.cc
libgtest_la_CPPFLAGS
=
\
$(AM_CPPFLAGS)
\
-I
$(top_srcdir)
/googletest
\
-I
$(top_srcdir)
/googletest/include
if
HAVE_PTHREAD
libgtest_la_CPPFLAGS
+=
-DGTEST_HAS_PTHREAD
=
1
libgtest_la_CXXFLAGS
=
$(PTHREAD_CFLAGS)
libgtest_la_LIDADD
=
$(PTHREAD_LIBS)
else
libgtest_la_CPPFLAGS
+=
-DGTEST_HAS_PTHREAD
=
0
endif
libgtestmain_la_CPPFLAGS
=
$(libgtest_la_CPPFLAGS)
libgtestmain_la_CXXFLAGS
=
$(libgtest_la_CXXFLAGS)
libgtestmain_la_LIBADD
=
$(libgtest_la_LIBADD)
libgtestmain_la_CPPFLAGS
=
$(AM_CPPFLAGS)
$(libgtest_la_CPPFLAGS)
unittest_SOURCES
=
\
test
/common/MediaLibraryTester.cpp
\
...
...
@@ -280,13 +312,13 @@ unittest_SOURCES = \
test
/unittest/AlbumTrackTests.cpp
\
test
/unittest/ArtistTests.cpp
\
test
/unittest/AudioTrackTests.cpp
\
test
/unittest/ChapterTests.cpp
\
test
/unittest/DeviceTests.cpp
\
test
/unittest/FileTests.cpp
\
test
/unittest/FolderTests.cpp
\
test
/unittest/FsUtilsTests.cpp
\
test
/unittest/UrlTests.cpp
\
test
/unittest/GenreTests.cpp
\
test
/unittest/HistoryTests.cpp
\
test
/unittest/LabelTests.cpp
\
test
/unittest/MediaTests.cpp
\
test
/unittest/MovieTests.cpp
\
...
...
@@ -296,6 +328,9 @@ unittest_SOURCES = \
test
/unittest/Tests.cpp
\
test
/unittest/VideoTrackTests.cpp
\
test
/unittest/MiscTests.cpp
\
test
/unittest/ThumbnailTests.cpp
\
test
/unittest/SubtitleTrackTests.cpp
\
test
/unittest/BookmarkTests.cpp
\
$(NULL)
EXTRA_DIST
+=
test
/unittest/db_v3.sql
...
...
@@ -305,16 +340,13 @@ unittest_CPPFLAGS = \
-DSRC_DIR
=
\"
$(abs_srcdir)
\"
\
-I
$(top_srcdir)
/test
\
-I
$(top_srcdir)
/googletest/include
\
$(SQLITE_CFLAGS)
\
$(VLCPP_CFLAGS)
\
$(VLC_CFLAGS)
\
$(libmedialibrary_la_CPPFLAGS)
\
$(NULL)
unittest_LDADD
=
\
libmedialibrary.la
\
libgtest.la
\
libgtestmain.la
\
$(PTHREAD_LIBS)
\
$(SQLITE_LIBS)
\
$(NULL)
...
...
@@ -329,24 +361,69 @@ samples_CPPFLAGS = \
-DSRC_DIR
=
\"
$(abs_srcdir)
\"
\
-I
$(top_srcdir)
/test
\
-I
$(top_srcdir)
/googletest/include
\
$(SQLITE_CFLAGS)
\
$(RAPIDJSON_CFLAGS)
\
$(VLCPP_CFLAGS)
\
$(VLC_CFLAGS)
\
$(libmedialibrary_la_CPPFLAGS)
\
$(NULL)
samples_LDADD
=
\
libmedialibrary.la
\
libgtest.la
\
libgtestmain.la
\
$(PTHREAD_LIBS)
\
$(SQLITE_LIBS)
\
$(NULL)
EXTRA_PROGRAMS
=
test_discoverer sqlite_load
test_discoverer_SOURCES
=
test
/discoverer/main.cpp
test_discoverer_CXXFLAGS
=
$(MEDIALIB_CPPFLAGS)
test_discoverer_LDADD
=
libmedialibrary.la
$(SQLITE_LIBS)
sqlite_load_SOURCES
=
test
/sqlite_load/SqliteLoadTest.cpp
sqlite_load_CPPFLAGS
=
-I
$(top_srcdir)
/test
sqlite_load_CXXFLAGS
=
$(MEDIALIB_CPPFLAGS)
sqlite_load_LDADD
=
libmedialibrary.la
$(SQLITE_LIBS)
endif
pkgconfigdir
=
$(libdir)
/pkgconfig
pkgconfig_DATA
=
medialibrary.pc
EXTRA_DIST
+=
medialibrary.pc
\
src/database/migrations/migration3-5.sql
\
src/database/migrations/migration7-8.sql
src/database/migrations/migration7-8.sql
\
src/database/migrations/migration13-14.sql
\
src/database/migrations/migration14-15.sql
\
src/database/migrations/migration15-16.sql
\
src/database/migrations/migration16-17.sql
\
src/database/migrations/migration17-18.sql
\
src/database/tables/File_v14.sql
\
src/database/tables/File_triggers_v14.sql
\
src/database/tables/Media_v14.sql
\
src/database/tables/Media_v17.sql
\
src/database/tables/Media_triggers_v14.sql
\
src/database/tables/Folder_v14.sql
\
src/database/tables/Folder_v15.sql
\
src/database/tables/Folder_v16.sql
\
src/database/tables/Folder_triggers_v14.sql
\
src/database/tables/Folder_triggers_v15.sql
\
src/database/tables/Playlist_v14.sql
\
src/database/tables/Playlist_v16.sql
\
src/database/tables/Playlist_triggers_v14.sql
\
src/database/tables/Playlist_triggers_v16.sql
\
src/database/tables/Metadata_v14.sql
\
src/database/tables/Device_v14.sql
\
src/database/tables/Task_v14.sql
\
src/database/tables/Task_v18.sql
\
src/database/tables/Task_triggers_v18.sql
\
src/database/tables/Thumbnail_v17.sql
\
src/database/tables/Thumbnail_triggers_v17.sql
\
src/database/tables/Thumbnail_v18.sql
\
src/database/tables/Thumbnail_triggers_v18.sql
\
src/database/tables/Artist_v16.sql
\
src/database/tables/Artist_v17.sql
\
src/database/tables/Album_v16.sql
\
src/database/tables/Album_v17.sql
\
src/database/tables/Bookmark_v17.sql
\
$(NULL)
configure.ac
View file @
c867021a
m4_define([MEDIALIB_MAJOR], [0])
m4_define([MEDIALIB_MINOR], [2])
m4_define([MEDIALIB_MICRO], [0])
AC_COPYRIGHT([Copyright 2014-2019 Hugo Beauzée-Luyssen - VideoLabs - VideoLAN])
AC_COPYRIGHT([Copyright 2014-2017 Hugo Beauzée-Luyssen - VideoLabs - VideoLAN])
AC_INIT([medialibrary], [MEDIALIB_MAJOR.MEDIALIB_MINOR.MEDIALIB_MICRO])
AC_INIT([medialibrary], [0.6.0-dev])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([foreign subdir-objects])
...
...
@@ -13,19 +9,12 @@ m4_ifdef([AM_SILENT_RULES], [
])
AC_CANONICAL_HOST
MEDIALIBRARY_MAJOR=MEDIALIB_MAJOR
MEDIALIBRARY_MINOR=MEDIALIB_MINOR
MEDIALIBRARY_MICRO=MEDIALIB_MICRO
AC_SUBST(MEDIALIBRARY_MAJOR)
AC_SUBST(MEDIALIBRARY_MINOR)
AC_SUBST(MEDIALIBRARY_MICRO)
AC_USE_SYSTEM_EXTENSIONS
LT_INIT([win32-dll shared disable-static])
AC_PROG_CXX
AC_PROG_OBJCXX
AX_CXX_COMPILE_STDCXX_1
1
([noext])
AX_CXX_COMPILE_STDCXX_1
4
([noext])
AC_CONFIG_MACRO_DIR([m4])
...
...
@@ -45,6 +34,9 @@ case "${host_os}" in
;;
linux*)
SYS=linux
CXXFLAGS="${CXXFLAGS} -pthread"
dnl Specify -lpthread as part of Libs.private, in case of a static build
THREAD_LIBS="-lpthread"
;;
bsdi*)
SYS=bsdi
...
...
@@ -96,6 +88,7 @@ case "${host_os}" in
OBJCXX="${OBJCXX} -stdlib=libc++ -std=c++11"
OBJCXXFLAGS="${OBJCXXFLAGS} -D_INTL_REDIRECT_MACROS ${ARCH_flag}"
LDFLAGS="${LDFLAGS} -Wl,-headerpad_max_install_names ${ARCH_flag}"
ML_EXTRA_LIBS="-Wl,-framework,Foundation -lmedialibrary_macos"
AC_EGREP_CPP(yes,
[#import <TargetConditionals.h>
...
...
@@ -156,7 +149,6 @@ case "${host_os}" in
;;
*mingw32* | *cygwin* | *wince* | *mingwce*)
CXXFLAGS="${CXXFLAGS} -static-libgcc -static-libstdc++"
AC_DEFINE([_UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
AC_DEFINE([UNICODE], [1], [Define to 1 for Unicode (Wide Chars) APIs.])
AC_DEFINE([_POSIX_C_SOURCE], [200809L], [IEEE Std 1003.1.])
AC_DEFINE([_BSD_SOURCE], [1], [ISO C, POSIX, and 4.3BSD things.])
...
...
@@ -173,28 +165,6 @@ case "${host_os}" in
if test "${SYS}" = "mingw32"; then
# DEP, ASLR, NO SEH
LDFLAGS="${LDFLAGS} -Wl,--nxcompat -Wl,--no-seh -Wl,--dynamicbase"
AC_CHECK_PROGS(U2D, [unix2dos todos], unix2dos)
ac_default_prefix="`pwd`/_win32"
DESTDIR="`pwd`/_win32/"
dnl
dnl NSIS/MSI Installer prefix and WIN64
dnl
case "${host}" in
amd64*|x86_64*)
HAVE_WIN64="1"
WINDOWS_ARCH="x64"
PROGRAMFILES="PROGRAMFILES64"
;;
*)
WINDOWS_ARCH="x86"
PROGRAMFILES="PROGRAMFILES"
;;
esac
AC_SUBST(WINDOWS_ARCH)
AC_SUBST(PROGRAMFILES)
fi
;;
*nto*)
...
...
@@ -223,6 +193,9 @@ AM_CONDITIONAL(HAVE_OSX, test "${HAVE_OSX}" = "1")
AM_CONDITIONAL(HAVE_TVOS, test "${HAVE_TVOS}" = "1")
AC_LANG_PUSH([C++])
AC_CHECK_FUNCS([link])
AC_MSG_CHECKING([c++11 thread support])
AC_COMPILE_IFELSE([AC_LANG_SOURCE([#include <thread>
int main() { std::thread t; }])], [
...
...
@@ -277,37 +250,42 @@ AS_IF([test "${enable_debug}" = "no"],[
AC_DEFINE(NDEBUG)
])
PKG_CHECK_MODULES(SQLITE, sqlite3)
PKG_CHECK_MODULES(VLC, libvlc >= 3.0)
PKG_CHECK_MODULES(VLCPP, libvlcpp,
[AC_MSG_RESULT([Found libvlcpp.pc])],
[
# Checking for files doesn't work when cross compiling. Simply assume
# The file is there
AC_MSG_RESULT([Falling back to submodule])
AC_SUBST([VLCPP_CFLAGS],[-I${srcdir}/libvlcpp])
]
)
PKG_CHECK_MODULES(LIBJPEG, libjpeg, [
have_libjpeg="yes"
AC_DEFINE(HAVE_JPEG, 1, [Define to 1 if libjpeg is available])
])
AC_ARG_WITH(libvlc, [AC_HELP_STRING([--with-libvlc], [build with libvlc integration (default enabled)])],, [with_libvlc=yes])
AH_TEMPLATE(HAVE_LIBVLC, [Define to 1 if libvlc integration is enabled])
AS_IF([test "${with_libvlc}" != "no"], [
AC_DEFINE(HAVE_LIBVLC)
PKG_CHECK_MODULES(VLC, libvlc >= 4.0, [have_libvlc4="yes"], [
PKG_CHECK_MODULES(VLC, libvlc >= 3.0)
])
PKG_CHECK_MODULES(VLCPP, libvlcpp,
[AC_MSG_RESULT([Found libvlcpp.pc])],
[
# Checking for files doesn't work when cross compiling. Simply assume
# The file is there
AC_MSG_RESULT([Falling back to submodule])
AC_SUBST([VLCPP_CFLAGS],[-I${srcdir}/libvlcpp])
]
)
PKG_CHECK_MODULES(LIBJPEG, libjpeg, [
have_libjpeg="yes"
AC_DEFINE(HAVE_JPEG, 1, [Define to 1 if libjpeg is available])
], [
dnl Falling back to libjpeg.h based detection
AC_CHECK_HEADERS(jpeglib.h, [
have_libjpeg="yes"
AC_SUBST([LIBJPEG_LIBS], "-ljpeg")
])
])
])
AM_CONDITIONAL(HAVE_LIBVLC, [test "${with_libvlc}" != "no"])
AM_CONDITIONAL(HAVE_LIBVLC4, [test "${have_libvlc4}" = "yes" ])
AM_CONDITIONAL([HAVE_LIBJPEG], [test "${have_libjpeg}" = "yes"])
AC_ARG_ENABLE(evas, AC_HELP_STRING([--enable-evas], [Use evas to compress thumbnails]))
AS_IF([test "$enable_evas" = "yes"],
[PKG_CHECK_MODULES(EVAS, evas, [
have_evas="yes"
AC_DEFINE(HAVE_EVAS, 1, [Define to 1 if evas is available])
])])
AM_CONDITIONAL([HAVE_EVAS], [test "${have_evas}" = "yes"])
PKG_CHECK_MODULES(SQLITE, sqlite3)
AC_ARG_ENABLE(tests,AC_HELP_STRING([--disable-tests], [Disable build of automated tests suites]))
AM_CONDITIONAL([HAVE_TESTS], [test "${enable_tests}" = "yes"])
AS_IF([test "${enable_tests}" = "yes"], [
AX_PTHREAD([have_pthread=yes],[have_pthread=no])
PKG_CHECK_MODULES(RAPIDJSON, RapidJSON, [], [
# We need the .pc for cross compilation, but we don't consider it a failure
# when building natively, mostly because debian doesn't package the .pc
...
...
@@ -318,7 +296,6 @@ AS_IF([test "${enable_tests}" = "yes"], [
fi
])
])
AM_CONDITIONAL([HAVE_PTHREAD], [test "${have_pthread}" = "yes"])
AH_BOTTOM([#include "Fixup.h"])
...
...
@@ -329,4 +306,8 @@ Makefile
medialibrary.pc
])
AC_SUBST([THREAD_LIBS])
AC_SUBST([ML_EXTRA_LIBS])
AC_SUBST([ML_EXTRA_PRIVATE_LIBS])
AC_OUTPUT
include/Fixup.h
View file @
c867021a
/*****************************************************************************
* Media Library
*****************************************************************************
* Copyright (C) 2015
Hugo Beauzée-Luyssen, Videolabs
* Copyright (C) 2015
-2019 Hugo Beauzée-Luyssen, Videolabs, VideoLAN
*
* Authors: Hugo Beauzée-Luyssen<hugo@beauzee.fr>
* Authors: Hugo Beauzée-Luyssen
<hugo@beauzee.fr>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
...
...
include/Types.h
View file @
c867021a
/*****************************************************************************
* Media Library
*****************************************************************************
* Copyright (C) 2016
Hugo Beauzée-Luyssen, Videolabs
* Copyright (C) 2016
-2019 Hugo Beauzée-Luyssen, Videolabs, VideoLAN
*
* Authors: Hugo Beauzée-Luyssen<hugo@beauzee.fr>
* Authors: Hugo Beauzée-Luyssen
<hugo@beauzee.fr>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
...
...
include/discoverer/IDiscoverer.h
View file @
c867021a
/*****************************************************************************
* Media Library
*****************************************************************************
* Copyright (C) 2015
Hugo Beauzée-Luyssen, Videolabs
* Copyright (C) 2015
-2019 Hugo Beauzée-Luyssen, Videolabs, VideoLAN
*
* Authors: Hugo Beauzée-Luyssen<hugo@beauzee.fr>
* Authors: Hugo Beauzée-Luyssen
<hugo@beauzee.fr>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
...
...
@@ -25,9 +25,10 @@
#include <string>
#include "Types.h"
#include "filesystem/IDirectory.h"
#include "filesystem/IFile.h"
#include "
medialibrary/
filesystem/IDirectory.h"
#include "
medialibrary/
filesystem/IFile.h"
#include "medialibrary/IMediaLibrary.h"
#include "medialibrary/IInterruptProbe.h"
namespace
medialibrary
{
...
...
@@ -36,12 +37,11 @@ class IDiscoverer
{
public:
virtual
~
IDiscoverer
()
=
default
;
// We assume the media library will always outlive the discoverers.
//FIXME: This is currently false since there is no way of interrupting
//a discoverer thread
virtual
bool
discover
(
const
std
::
string
&
entryPoint
)
=
0
;
virtual
bool
reload
()
=
0
;
virtual
bool
reload
(
const
std
::
string
&
entryPoint
)
=
0
;
virtual
bool
discover
(
const
std
::
string
&
entryPoint
,
const
IInterruptProbe
&
interruptProbe
)
=
0
;
virtual
bool
reload
(
const
IInterruptProbe
&
interruptProbe
)
=
0
;
virtual
bool
reload
(
const
std
::
string
&
entryPoint
,
const
IInterruptProbe
&
interruptProbe
)
=
0
;
};
}
...
...
include/medialibrary/IAlbum.h
View file @
c867021a
/*****************************************************************************
* Media Library
*****************************************************************************
* Copyright (C) 2015
Hugo Beauzée-Luyssen, Videolabs
* Copyright (C) 2015
-2019 Hugo Beauzée-Luyssen, Videolabs, VideoLAN
*
* Authors: Hugo Beauzée-Luyssen<hugo@beauzee.fr>
* Authors: Hugo Beauzée-Luyssen
<hugo@beauzee.fr>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
...
...
@@ -22,7 +22,6 @@
#pragma once
#include <vector>
#include <string>
#include "IMediaLibrary.h"
...
...
@@ -41,33 +40,58 @@ public:
*/
virtual
unsigned
int
releaseYear
()
const
=
0
;
virtual
const
std
::
string
&
shortSummary
()
const
=
0
;
virtual
const
std
::
string
&
artworkMrl
()
const
=
0
;
/**
* @brief isThumbnailGenerated Returns true is a thumbnail generation was attempted.
*
* If the thumbnail generation failed, this will still return true, and the
* associated thumbnail mrl will be empty.
*/
virtual
bool
isThumbnailGenerated
(
ThumbnailSizeType
sizeType
)
const
=
0
;
virtual
const
std
::
string
&
thumbnailMrl
(
ThumbnailSizeType
sizeType
)
const
=
0
;
/**
* @brief tracks fetches album tracks from the database
*/
virtual
std
::
vector
<
MediaPtr
>
tracks
(
SortingCriteria
sort
=
SortingCriteria
::
Default
,
bool
desc
=
false
)
const
=
0
;
virtual
Query
<
IMedia
>
tracks
(
const
QueryParameters
*
params
=
nullptr
)
const
=
0
;
/**
* @brief tracks fetches album tracks, filtered by genre
* @param genre A musical genre. Only tracks of this genre will be returned
* @return
*/
virtual
std
::
vector
<
MediaPtr
>
tracks
(
GenrePtr
genre
,
SortingCriteria
sort
=
SortingCriteria
::
Default
,
bool
desc
=
false
)
const
=
0
;
virtual
Query
<
IMedia
>
tracks
(
GenrePtr
genre
,
const
QueryParameters
*
params
=
nullptr
)
const
=
0
;
/**
* @brief albumArtist Returns the album main artist (generally tagged as album-artist)
* This can be an artist that doesn't appear on the album, and is solely dependent
* on the most present AlbumArtist tag for all of this album's tracks
*/
virtual
ArtistPtr
albumArtist
()
const
=
0
;
/**
* @brief artists Returns a vector of all additional artists appearing on the album.
* @brief artists Returns a Query object representing all artists appearing
* on at least one track for this album.
* Artists are sorted by name.
* @param desc
*/
virtual
std
::
vector
<
ArtistPtr
>
artists
(
bool
desc
)
const
=
0
;
virtual
Query
<
IArtist
>
artists
(
const
QueryParameters
*
params
=
nullptr
)
const
=
0
;
/**
* @brief nbTracks Returns the amount of track in this album.
* The value is cached, and doesn't require fetching anything.
*/
virtual
uint32_t
nbTracks
()
const
=
0
;
virtual
unsigned
int
duration
()
const
=
0
;
/**
* @brief nbDiscs Returns the total number of discs for this album.
* Defaults to 1
*/
virtual
uint32_t
nbDiscs
()
const
=
0
;
/**
* @brief duration Returns the total album duration in milliseconds
*/
virtual
int64_t
duration
()
const
=
0
;
/**
* @brief isUnknownAlbum returns true is this is an unknown album
*/
virtual
bool
isUnknownAlbum
()
const
=
0
;
virtual
Query
<
IMedia
>
searchTracks
(
const
std
::
string
&
pattern
,
const
QueryParameters
*
params
=
nullptr
)
const
=
0
;
};
}
include/medialibrary/IAlbumTrack.h
View file @
c867021a
/*****************************************************************************
* Media Library
*****************************************************************************
* Copyright (C) 2015
Hugo Beauzée-Luyssen, Videolabs
* Copyright (C) 2015
-2019 Hugo Beauzée-Luyssen, Videolabs, VideoLAN
*
* Authors: Hugo Beauzée-Luyssen<hugo@beauzee.fr>
* Authors: Hugo Beauzée-Luyssen
<hugo@beauzee.fr>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
...
...
@@ -43,10 +43,12 @@ class IAlbumTrack
* @return
*/
virtual
ArtistPtr
artist
()
const
=
0
;
virtual
int64_t
artistId
()
const
=
0
;
virtual
GenrePtr
genre
()
=
0
;
virtual
unsigned
int
trackNumber
()
=
0
;
virtual
int64_t
genreId
()
const
=
0
;
virtual
unsigned
int
trackNumber
()
const
=
0
;
virtual
AlbumPtr
album
()
=
0
;
virtual
MediaPtr
media
()
=
0
;
virtual
int64_t
albumId
()
const
=
0
;
/**
* @return Which disc this tracks appears on (or 0 if unspecified)
*/
...
...
include/medialibrary/IArtist.h
View file @
c867021a
/*****************************************************************************
* Media Library
*****************************************************************************
* Copyright (C) 2015
Hugo Beauzée-Luyssen, Videolabs
* Copyright (C) 2015
-2019 Hugo Beauzée-Luyssen, Videolabs, VideoLAN
*
* Authors: Hugo Beauzée-Luyssen<hugo@beauzee.fr>
* Authors: Hugo Beauzée-Luyssen
<hugo@beauzee.fr>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
...
...
@@ -23,7 +23,6 @@
#pragma once
#include <string>
#include <vector>
#include "IMediaLibrary.h"
...
...
@@ -43,9 +42,33 @@ public:
* This will return all albums by this artist, and all album the artist
* appeared on, even if they are not the main artist (or AlbumArtist)
*/
virtual
std
::
vector
<
AlbumPtr
>
albums
(
SortingCriteria
sort
=
SortingCriteria
::
Default
,
bool
desc
=
false
)
const
=
0
;
virtual
std
::
vector
<
MediaPtr
>
media
(
SortingCriteria
sort
=
SortingCriteria
::
Default
,
bool
desc
=
false
)
const
=
0
;
virtual
const
std
::
string
&
artworkMrl
()
const
=
0
;
virtual
Query
<
IAlbum
>
albums
(
const
QueryParameters
*
params
=
nullptr
)
const
=
0
;
virtual
Query
<
IAlbum
>
searchAlbums
(
const
std
::
string
&
pattern
,
const
QueryParameters
*
params
=
nullptr
)
const
=
0
;
virtual
Query
<
IMedia
>
tracks
(
const
QueryParameters
*
params
=
nullptr
)
const
=
0
;
virtual
Query
<
IMedia
>
searchTracks
(
const
std
::
string
&
pattern
,
const
QueryParameters
*
params
=
nullptr
)
const
=
0
;
/**
* @brief isThumbnailGenerated Returns true is a thumbnail generation was
* attempted for the provided size.
*
* @param sizeType The targeted thumbnail size
*
* If the thumbnail generation failed, this will still return true, and the
* associated thumbnail mrl will be empty.
*/
virtual
bool
isThumbnailGenerated
(
ThumbnailSizeType
sizeType
)
const
=
0
;
virtual
const
std
::
string
&
thumbnailMrl
(
ThumbnailSizeType
sizeType
)
const
=
0
;
/**
* @brief setThumbnail Assign a thumbnail to the artist
* @param thumbnailMrl An mrl pointing to the thumbnail
* @return true in case of success, false otherwise
*
* @note The medialibrary does not take ownership of the thumbnail. It is
* application responsibility to ensure that it will always be available
* or that a later call will invalidate the thumbnail if it gets (re)moved
*/
virtual
bool
setThumbnail
(
const
std
::
string
&
thumbnailMrl
,
ThumbnailSizeType
sizeType
)
=
0
;
virtual
const
std
::
string
&
musicBrainzId
()
const
=
0
;
/**
* @brief nbAlbums
...
...
include/medialibrary/IAudioTrack.h
View file @
c867021a
/*****************************************************************************
* Media Library
*****************************************************************************
* Copyright (C) 2015
Hugo Beauzée-Luyssen, Videolabs
* Copyright (C) 2015
-2019 Hugo Beauzée-Luyssen, Videolabs, VideoLAN
*
* Authors: Hugo Beauzée-Luyssen<hugo@beauzee.fr>
* Authors: Hugo Beauzée-Luyssen
<hugo@beauzee.fr>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
...
...
@@ -20,8 +20,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef IAUDIOTRACK_H
#define IAUDIOTRACK_H
#pragma once
#include "IMediaLibrary.h"
...
...
@@ -30,20 +29,18 @@ namespace medialibrary
class
IAudioTrack
{
public:
virtual
~
IAudioTrack
()
{}
virtual
int64_t
id
()
const
=
0
;
virtual
const
std
::
string
&
codec
()
const
=
0
;
/**
* @return The bitrate in bits per second
*/
virtual
unsigned
int
bitrate
()
const
=
0
;
virtual
unsigned
int
sampleRate
()
const
=
0
;
virtual
unsigned
int
nbChannels
()
const
=
0
;
virtual
const
std
::
string
&
language
()
const
=
0
;
virtual
const
std
::
string
&
description
()
const
=
0
;
public:
virtual
~
IAudioTrack
()
=
default
;
virtual
int64_t
id
()
const
=
0
;
virtual
const
std
::
string
&
codec
()
const
=
0
;
/**
* @return The bitrate in bits per second
*/
virtual
unsigned
int
bitrate
()
const
=
0
;
virtual
unsigned
int
sampleRate
()
const
=
0
;
virtual
unsigned
int
nbChannels
()
const
=
0
;
virtual
const
std
::
string
&
language
()
const
=
0
;
virtual
const
std
::
string
&
description
()
const
=
0
;
};
}
#endif // IAUDIOTRACK_H
include/medialibrary/IBookmark.h
0 → 100644
View file @
c867021a
/*****************************************************************************
* Media Library
*****************************************************************************
* Copyright (C) 2019 Hugo Beauzée-Luyssen, Videolabs, VideoLAN
*
* Authors: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#pragma once
#include <cstdint>
#include <string>
namespace
medialibrary
{
class
IBookmark
{
public:
virtual
~
IBookmark
()
=
default
;
/**
* @brief time Returns the time of this bookmark, as it was
* provided to \ref{IMedia::addBookmark}
*/
virtual
int64_t
time
()
const
=
0
;
/**
* @brief name Returns the bookmark name
*/
virtual
const
std
::
string
&
name
()
const
=
0
;
/**
* @brief setName Updates the bookmark name
*/
virtual
bool
setName
(
std
::
string
name
)
=
0
;
/**
* @brief name Returns the bookmark description
*/
virtual
const
std
::
string
&
description
()
const
=
0
;
/**
* @brief setDescription Updates the bookmark description
*/
virtual
bool
setDescription
(
std
::
string
description
)
=
0
;
/**
* @brief setNameAndDescription Convenience helper to update the name and
* description in a single operation
*/
virtual
bool
setNameAndDescription
(
std
::
string
name
,
std
::
string
desc
)
=
0
;
/**
* @brief move Move a bookmark to a new time in the media
* @param newTime The new time for this bookmark
* @return true if successful, false otherwise.
*
* @note If a bookmark is already present at the given time, the move will fail
*/
virtual
bool
move
(
int64_t
newTime
)
=
0
;
};
}
include/medialibrary/IChapter.h
0 → 100644
View file @
c867021a
/*****************************************************************************
* Media Library
*****************************************************************************
* Copyright (C) 2018-2019 Hugo Beauzée-Luyssen, Videolabs, VideoLAN
*
* Authors: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#pragma once
#include <string>
namespace
medialibrary
{
class
IChapter
{
public:
virtual
~
IChapter
()
=
default
;
/**
* @brief name Returns the chapter name
*/
virtual
const
std
::
string
&
name
()
const
=
0
;
/**
* @brief offset Returns the offset from the start of the media in seconds
*/
virtual
int64_t
offset
()
const
=
0
;
/**
* @brief duration Returns the duration of this chapter in seconds
*/
virtual
int64_t
duration
()
const
=
0
;
};
}
include/medialibrary/IDeviceLister.h
View file @
c867021a
/*****************************************************************************
* Media Library
*****************************************************************************
* Copyright (C) 2015
Hugo Beauzée-Luyssen, Videolabs
* Copyright (C) 2015
-2019 Hugo Beauzée-Luyssen, Videolabs, VideoLAN
*
* Authors: Hugo Beauzée-Luyssen<hugo@beauzee.fr>
* Authors: Hugo Beauzée-Luyssen
<hugo@beauzee.fr>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
...
...
@@ -28,22 +28,30 @@
namespace
medialibrary
{
/**
* @brief IDeviceListerCb is intended for external device listers to signal device modifications
*
* An external device lister shall only be used when the medialibrary can't list
* the devices itself.
* The device/folder/file management will still be the medialibrary's responsability
*/
class
IDeviceListerCb
{
public:
virtual
~
IDeviceListerCb
()
=
default
;
/**
* @brief onDevice
Plugged Shall be invoked when a known device gets plugg
ed
* @brief onDevice
Mounted Shall be invoked when a known device gets mount
ed
* @param uuid The device UUID
* @param mountpoint The device new mountpoint
* @returns true is the device was unknown. false otherwise
*/
virtual
bool
onDevice
Plugg
ed
(
const
std
::
string
&
uuid
,
const
std
::
string
&
mountpoint
)
=
0
;
virtual
bool
onDevice
Mount
ed
(
const
std
::
string
&
uuid
,
const
std
::
string
&
mountpoint
)
=
0
;
/**
* @brief onDeviceUn
plugged Shall be invoked when a known device gets unplugg
ed
* @brief onDeviceUn
mounted Shall be invoked when a known device gets unmount
ed
* @param uuid The device UUID
* @param mountpoint The mountpoint the device was mounted on
*/
virtual
void
onDeviceUn
plugged
(
const
std
::
string
&
uuid
)
=
0
;
virtual
void
onDeviceUn
mounted
(
const
std
::
string
&
uuid
,
const
std
::
string
&
mountpoint
)
=
0
;
/**
* @brief isDeviceKnown Returns true is the provided device is already known to the media library
*
...
...
include/medialibrary/IFile.h
View file @
c867021a
/*****************************************************************************
* Media Library
*****************************************************************************
* Copyright (C) 2015
Hugo Beauzée-Luyssen, Videolabs
* Copyright (C) 2015
-2019 Hugo Beauzée-Luyssen, Videolabs, VideoLAN
*
* Authors: Hugo Beauzée-Luyssen<hugo@beauzee.fr>
* Authors: Hugo Beauzée-Luyssen
<hugo@beauzee.fr>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
...
...
@@ -30,6 +30,12 @@ namespace medialibrary
class
IFile
{
public:
/**
* @brief Describes the type of a file
* @warning These values are stored in DB. As such, any new value must be
* appended, as modifying the existing values would invalidate any
* existing db record.
*/
enum
class
Type
{
/// Unknown type, so far
...
...
@@ -44,18 +50,43 @@ public:
Subtitles
,
/// A playlist File
Playlist
,
/// A disc file. Also considered to be a "main" file
Disc
,
};
virtual
~
IFile
()
=
default
;
virtual
int64_t
id
()
const
=
0
;
/**
* @brief mrl Returns the full mrl for this file.
* Since we can't compute an mrl for a file or folder that is/was present on
* a removable storage or network share that is not mounted, a
* fs::DeviceRemovedException will be thrown when trying to get the mrl of
* a non present file.
* You should always account for this exception is isRemovable returns true.
* If for some reasons we can't compute the MRL, an empty string will be returned
* @return The folder's mrl
*/
virtual
const
std
::
string
&
mrl
()
const
=
0
;
virtual
Type
type
()
const
=
0
;
virtual
unsigned
int
lastModificationDate
()
const
=
0
;
virtual
unsigned
int
size
()
const
=
0
;
virtual
bool
isRemovable
()
const
=
0
;
///
/// \brief isExternal returns true if this stream isn't managed by the medialibrary
///
virtual
bool
isExternal
()
const
=
0
;
/**
* @brief isNetwork returns true if this file is on a network location
*
* If the file is external, this is a best guess effort.
*/
virtual
bool
isNetwork
()
const
=
0
;
/**
* @brief isMain Returns true if this file is the main file of a media
*
* This can be used to have a Disc file considered as the main file
*/
virtual
bool
isMain
()
const
=
0
;
};
}
include/medialibrary/IFolder.h
View file @
c867021a
/*****************************************************************************
* Media Library
*****************************************************************************
* Copyright (C) 2015
Hugo Beauzée-Luyssen, Videolabs
* Copyright (C) 2015
-2019 Hugo Beauzée-Luyssen, Videolabs, VideoLAN
*
* Authors: Hugo Beauzée-Luyssen<hugo@beauzee.fr>
* Authors: Hugo Beauzée-Luyssen
<hugo@beauzee.fr>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
...
...
@@ -23,6 +23,9 @@
#pragma once
#include <string>
#include "IQuery.h"
#include "IMedia.h"
#include "IMediaLibrary.h"
namespace
medialibrary
{
...
...
@@ -34,19 +37,84 @@ public:
virtual
int64_t
id
()
const
=
0
;
/**
* @brief mrl Returns the full mrl for this folder.
* Caller is responsible for checking isPresent() beforehand, as we
* can't compute an for a folder that is/was present on a removable storage
* or network share that has been unplugged
* If for some reasons we can't compute the MRL, an empty string wil
* Since we can't compute an mrl for a folder that is/was present on a
* removable storage or network share that is not mounted, a
* fs::DeviceRemovedException will be thrown when trying to get the mrl of
* a non present folder.
* Calling isPresent can prevent this to be called with a known missing
* device, but there is always a window between a call to isPresent and mrl()
* in which the device could be removed.
* When calling this function on a removable device, you should check
* for fs::DeviceRemovedException in any case.
* If for some reasons we can't compute the MRL, an empty string will be returned
* @return The folder's mrl
*/
virtual
const
std
::
string
&
mrl
()
const
=
0
;
virtual
const
std
::
string
&
name
()
const
=
0
;
virtual
bool
isPresent
()
const
=
0
;
virtual
bool
isRemovable
()
const
=
0
;
/**
* @brief isBanned Will return true if the folder was explicitely banned
* from being discovered.
*/
virtual
bool
isBanned
()
const
=
0
;
/**
* @brief media Returns the media contained by this folder.
* @param type The media type, or IMedia::Type::Unknown for all types
* @param params A query parameter instance, or nullptr for the default
* @return A Query object to be used to fetch the results
*
* This function will only return the media contained in the folder, not
* the media contained in subfolders.
* A media is considered to be in a directory when the main file representing
* it is part of the directory.
* For instance, in this file hierarchy:
* .
* ├── a
* │ ├── c
* │ │ └── NakedMoleRat.asf
* │ └── seaotter_themovie.srt
* └── b
* └── seaotter_themovie.mkv
* Media of 'a' would be empty (since the only file is a subtitle file and
* not the actual media, and NakedMoleRat.asf
* is in a subfolder)
* Media of 'c' would contain NakedMoleRat.asf
* Media of 'b' would contain seaotter_themovie.mkv
*/
virtual
Query
<
IMedia
>
media
(
IMedia
::
Type
type
,
const
QueryParameters
*
params
)
const
=
0
;
/**
* @brief searchMedia Search the media of a given folder
* @param pattern The pattern to search for
* @param type The media type, or IMedia::Type::Unknown for all types
* @param params A query parameter instance, or nullptr for the default
* @return A Query object to be used to fetch the results
*
* This only search for the folder in a specific folder, not including the
* media in its subfolders.
*/
virtual
Query
<
IMedia
>
searchMedia
(
const
std
::
string
&
pattern
,
IMedia
::
Type
type
,
const
QueryParameters
*
params
=
nullptr
)
const
=
0
;
/**
* @brief subfolders Returns the subfolders contained folder
* @return A query object to be used to fetch the results