Commit Graph

413 Commits

Author SHA1 Message Date
Max Kellermann b7a7953757 db/Directory: use "unsigned" for inode and device
This is what we get from the storage plugin via FileInfo.  Fixes a
compiler warning on Mac OS X where dev_t appears to be signed.
2014-02-21 10:48:43 +01:00
Max Kellermann e92a41fa3a db/upnp: move plugin source to upnp directory 2014-02-19 23:46:00 +01:00
Max Kellermann 150443b014 DatabasePlugin: add FLAG_REQUIRE_STORAGE
Ignore the storage configuration if FLAG_REQUIRE_STORAGE is not set in
the DatabasePlugin.
2014-02-19 23:24:17 +01:00
Max Kellermann 9e36af7916 DatabasePlugin: add attribute "flags" 2014-02-19 23:24:15 +01:00
Max Kellermann 85b8675e7a db/Interface: add attribute "plugin"
The new method IsPlugin() replaces the "is_simple" flag.
2014-02-19 23:17:21 +01:00
Max Kellermann ae594ad92c DatabasePlugin: split header 2014-02-19 22:54:52 +01:00
Max Kellermann 579e48edbb util/StringUtil: add function Strip()
Replaces g_strstrip().
2014-02-17 22:37:43 +01:00
Max Kellermann 91729437a0 Main: initialize Database before Storage 2014-02-17 22:14:00 +01:00
Max Kellermann 1ddd00433e db/Configured: disallow both "db_file" and "database"
This is misconfiguration, and MPD should abort.
2014-02-17 22:13:53 +01:00
Max Kellermann de160bb2d1 Main: move code to db/Configured.cxx 2014-02-17 22:13:53 +01:00
Max Kellermann 6da0af94df db/DatabaseSimple: remove obsolete header 2014-02-17 20:44:03 +01:00
Max Kellermann 2182209a8a db/update/Walk: disable FindAncestorLoop() if device/inode==0 2014-02-09 10:47:29 +01:00
Max Kellermann e29a8b3a9c db/update/Walk: document FindAncestorLoop() 2014-02-09 10:46:39 +01:00
Max Kellermann ace3f37af4 db/update/Walk: rename find_inode_ancestor() to FindAncestorLoop() 2014-02-09 10:46:39 +01:00
Max Kellermann fe7c6fee34 ArchivePlugin: pass Path to open() 2014-02-08 13:25:44 +01:00
Max Kellermann 9906daeca7 ArchivePlugin: rename struct archive_plugin to ArchivePlugin 2014-02-08 13:22:13 +01:00
Max Kellermann f947274626 InotifyUpdate: use class Storage instead of Mapper.cxx 2014-02-07 22:30:40 +01:00
Max Kellermann f6939f71a7 InotifyUpdate: use the root name instead of mapper_get_music_directory_fs()
The root WatchDirectory instance already contains the music directory,
and we don't need to fetch it again.
2014-02-07 22:30:01 +01:00
Max Kellermann 25aa17ad89 InotifyUpdate: move functions into the WatchDirectory class 2014-02-07 22:24:26 +01:00
Max Kellermann 05ee057db5 InotifyUpdate: remove unnecessary #ifdefs 2014-02-07 22:17:27 +01:00
Max Kellermann ffd16b55a6 StoragePlugin: add method MapToRelativeUTF8()
Replaces map_to_relative_path() from Mapper.cxx.
2014-02-07 19:09:28 +01:00
Max Kellermann 6b421cc354 DecoderPlugin: pass Path instance to file_decode() and scan_file() 2014-02-07 18:52:19 +01:00
Max Kellermann 4ab4cf8532 SongUpdate: pass Storage to UpdateFileInArchive() 2014-02-07 18:44:47 +01:00
Max Kellermann c13810ebaa Mapper: move map_song_detach() to db/DatabaseSong.cxx
Use Storage::MapUTF8() internally, don't use global variables.
2014-02-07 00:42:14 +01:00
geneticdrift 0f1f509be7 fixed leaked LocalDirectoryReader *const reader in UpdateWalk::UpdateDirectory 2014-02-06 23:08:24 +01:00
Max Kellermann 29b18d9ab7 SongUpdate: use the Storage interface, support remote files
This commit finally allows the database update to scan remote files,
e.g. using the smbclient storage plugin.  However, it is not yet
possible to configure that, therefore the feature is not accessible
yet.
2014-02-06 19:06:08 +01:00
Max Kellermann f6682aae77 db/update: include StorageInterface.hxx instead of LocalStorage.hxx 2014-02-05 19:26:18 +01:00
Max Kellermann 0ba1b73395 storage: add abstract interface
Prepare for the plugin interface.
2014-02-05 18:53:51 +01:00
Max Kellermann 4c995eb498 db/UpdateWalk: move LocalStorage to Instance
Keep only a reference.
2014-02-05 17:58:13 +01:00
Max Kellermann 144cfe70bf db/update/Remove: initialize attribute "removed_song"
Fixes bogus assertion failure.
2014-02-05 17:58:13 +01:00
Max Kellermann 9ae7f186bc LocalStorage: new API abstracting filesystem walk
Prepare to make this a new plugin API, for example to use a SMB share
for the music_directory.
2014-02-05 10:04:03 +01:00
Max Kellermann f8d114be42 db/UpdateIO: add "pure" attributes 2014-02-05 10:04:03 +01:00
Max Kellermann 2c70251df1 db/UpdateGlue: relax assertion
Fixes assertion failure when update gets launched during MPD startup.
2014-02-05 10:04:03 +01:00
Max Kellermann ff665b37cb db/DatabaseListener: add method OnDatabaseSongRemoved()
Decouples db/update/Remove.cpp from global variables.
2014-02-04 19:53:37 +01:00
Max Kellermann ce73843014 db/proxy: include cleanup 2014-02-04 19:53:12 +01:00
Max Kellermann eec6d09959 db/update/Service: use DatabaseListener instead of Instance
Don't use the global variable "instance".
2014-02-04 18:54:54 +01:00
Max Kellermann c5fa8ed321 db/update/Service: use EventLoop::IsInside()
Don't use the global variable "main_thread".
2014-02-04 18:54:45 +01:00
Max Kellermann cf6281a5a7 Instance: add Database attribute
Move from db/DatabaseGlue.cxx, eliminating global variable.
2014-02-04 11:22:33 +01:00
Max Kellermann c953904343 db/update/Service: initialize "progress" and "update_task_id"
Database update was randomly broken due to these uninitialized
variables.
2014-02-04 11:22:13 +01:00
Max Kellermann d76b6f878e db/update/Service: add SimpleDatabase reference
Don't use the global variables from the DatabaseSimple library.
2014-02-04 09:05:32 +01:00
Max Kellermann f25ef8d682 db/update/Walk: add Directory reference parameter
Remove dependency on the DatabaseSimple library.
2014-02-04 09:05:32 +01:00
Max Kellermann 33a2c01ea2 db/Simple: remove unused function db_get_directory() 2014-02-04 09:03:17 +01:00
Max Kellermann 29072797ca db/DatabasePlaylist: pass Database reference around
Reduce global variable usage, move to frontend code.
2014-02-04 00:57:43 +01:00
Max Kellermann db69ceade6 db/LightSong: make "real_uri" a pointer
Reduce overhead.  LightSong can always point to the "real" allocated
string.
2014-02-04 00:38:52 +01:00
Max Kellermann 78689645dc db/update/Archive: delete archive from database on error 2014-01-31 22:24:28 +01:00
Max Kellermann 26970579b8 db/update/Editor: add locking method variants 2014-01-31 22:17:49 +01:00
Max Kellermann 04b4f53488 db/update: convert runtime check to assertion 2014-01-31 21:59:35 +01:00
Max Kellermann a631200cca update/Walk: declare std::string at assignment
Reduce overhead.
2014-01-30 22:19:56 +01:00
Max Kellermann c6725884bc db/update: convert to OO API
Move global variables into the new classes.  That may allow multiple
update threads for multiple databases one day.
2014-01-30 18:47:05 +01:00
Max Kellermann d5b017407d ExcludeList: move to db/update/ 2014-01-30 10:11:12 +01:00