Max Kellermann
cd041f8574
decoder/Plugin: container_scan() returns AllocatedString
2016-04-13 12:23:10 +02:00
Max Kellermann
2fd5182608
db/Interface: GetSong() throws exception on error
2016-03-19 00:19:50 +01:00
Max Kellermann
f55bdf07d3
db/Interface: Open() throws exception on error
2016-03-19 00:05:11 +01:00
Max Kellermann
6c2b532ae3
db/proxy: throw exception on error
2016-03-19 00:02:50 +01:00
Max Kellermann
2539f294e4
db/proxy: move code to MakeError()
...
Use this function instead of CheckError() when we already know an
error has occurred.
2016-03-18 23:43:28 +01:00
Max Kellermann
b6a3ce9305
db/proxy: fix inconsistent error handling in VisitUniqueTags()
2016-03-18 23:42:04 +01:00
Max Kellermann
b07495aae9
db/proxy: remove superfluous CheckError() call
2016-03-18 23:41:24 +01:00
Max Kellermann
686a53215d
db/proxy: use AtScopeExit()
2016-03-18 23:10:42 +01:00
Max Kellermann
6fd7d8191e
db/simple: refactor Check() to throw exception
2016-03-18 22:21:09 +01:00
Max Kellermann
2ccd1cc9f0
db/simple: remove misplaced "pure" attribute
2016-03-18 22:18:09 +01:00
Max Kellermann
8167bdd978
db/simple: handle Database::Open() exceptions in Mount()
2016-03-18 18:55:54 +01:00
Max Kellermann
dfb3e34f7b
db/lazy: remove obsolete class
...
Obsoleted by commit d4d4d621
2016-03-18 18:48:27 +01:00
Max Kellermann
45ee75055e
db/upnp: remove obsolete code comment
2016-03-18 18:48:00 +01:00
Max Kellermann
7e096ee2c5
db/update/Remove: update code comment
2016-03-18 16:58:06 +01:00
Max Kellermann
86a90daf1b
db/update/Remove: pass URI to Remove()
2016-03-18 16:57:43 +01:00
Max Kellermann
42f7df9681
db/update/Remove: reimplement as a non-blocking queue
...
This reduces overhead for two reasons:
1. calls to Remove() are non-blocking
2. RunDeferred() may work on large chunks at a time, reducing the
number of RunDeferred() calls
2016-03-18 16:43:02 +01:00
Max Kellermann
2edad38c7c
db/DatabaseListener: pass URI to OnDatabaseSongRemoved()
...
There's no point in passing a LightSong reference here; the callee is
interested only in the URI.
2016-03-18 16:22:33 +01:00
Max Kellermann
099455db25
db/update/Service: convert const to constexpr
2016-03-05 20:08:01 +01:00
Max Kellermann
3146bf51e6
db/update/Service: eliminate attribute "progress"
...
Use walk!=nullptr instead.
2016-03-05 19:40:11 +01:00
Max Kellermann
1aee89f5ea
*: include cleanup (using iwyu)
2016-03-01 22:08:13 +01:00
Max Kellermann
65386f52f0
db/proxy: throw DatabaseError on error
2016-02-28 11:47:03 +01:00
Max Kellermann
5b8dce7456
db/simple: throw DatabaseError on error
2016-02-28 11:40:59 +01:00
Max Kellermann
de938eb621
db/simple: handle exception in Open() properly, fix memory leak
2016-02-28 11:40:39 +01:00
Max Kellermann
83cc6c0835
db/simple: use second Error instance in Open()
...
Don't need to clear the caller-specified one.
2016-02-28 11:38:22 +01:00
Max Kellermann
b6cb9b853a
queue/PlaylistEdit: throw PlaylistError on error
2016-02-28 11:02:36 +01:00
Max Kellermann
1d67aa7bf2
update copyright year to 2016
2016-02-26 17:54:05 +01:00
Max Kellermann
d9e8ce22cb
util/Error: use std::exception_ptr instead of std::exception
...
Necessary to preserve type information. The try/catch sequence didn't
work previously.
Same fix as in commit 1c904000
2016-02-26 16:32:24 +01:00
Max Kellermann
a670ff6d3e
SongUpdate: remove obsolete overload UpdateFileInArchive(Storage)
2016-02-26 15:06:16 +01:00
Max Kellermann
32f6d34904
db/update/Archive: rescan tags on existing songs in archive
...
This is the final piece for full ID3/APE support in archives.
2016-02-26 15:05:49 +01:00
Max Kellermann
96f4394dce
db/update/Archive: pass ArchiveFile to Song constructor
...
Don't open the ZIP file again and again for each song file.
2016-02-26 15:05:40 +01:00
Max Kellermann
35567e6507
SongUpdate: add UpdateFileInArchive(ArchiveFile&)
2016-02-26 14:53:37 +01:00
Max Kellermann
6c5bc9b4a3
lib/expat: use C++ exceptions instead of class Error
2016-02-07 12:58:20 +01:00
Max Kellermann
cd2f65aafc
upnp/ContentDirectoryService: use AtScopeExit() for ixmlDocument_free()
...
For exception-safety.
2016-02-07 12:56:55 +01:00
Max Kellermann
3ee5093b03
lib/upnp: use C++ exceptions instead of class Error
2016-02-07 12:53:21 +01:00
Max Kellermann
4b79f0047d
db/DatabaseError: add exception class DatabaseError
2016-02-07 01:09:33 +01:00
Max Kellermann
0d8e44a079
db/DatabaseError: rename enum db_error and make strictly-typed
2016-02-07 01:01:10 +01:00
Max Kellermann
f3503e0026
fs/DirectoryReader: use C++ exceptions instead of class Error
2015-12-29 12:56:26 +01:00
Max Kellermann
1f184f4aec
PlaylistFile: throw exception on spl_map_to_fs() failure
2015-12-28 14:20:37 +01:00
Max Kellermann
7562c5751c
db/Configured: allocate ConfigBlock on the stack
2015-12-18 09:17:12 +01:00
Max Kellermann
e6e7d6dbd6
fs/io/Reader: use C++ exceptions instead of class Error
2015-12-18 01:08:16 +01:00
Max Kellermann
e4a06da14e
fs/io/OutputStream: use C++ exceptions in Write()
2015-12-16 10:24:43 +01:00
Max Kellermann
36d6ead65c
fs/io/GzipOutputStream: use C++ exceptions in constructor
2015-12-16 10:14:56 +01:00
Max Kellermann
7eae3bc8c5
fs/io/FileOutputStream: use C++ exceptions in Commit()
2015-12-16 00:33:33 +01:00
Max Kellermann
24b2198668
fs/io/FileOutputStream: use C++ exceptions in constructor
2015-12-16 00:33:30 +01:00
Max Kellermann
d29be0f460
db/simple: use std::unique_ptr<GzipOutputStream>
2015-12-16 00:33:10 +01:00
Max Kellermann
c11345c4d9
db/DatabaseLock: add class ScopeDatabaseUnlock
2015-12-16 00:07:51 +01:00
Max Kellermann
e31f0b8b0c
db/simple: use class ScopeDatabaseLock
2015-12-16 00:07:51 +01:00
Max Kellermann
7dd3b72a8c
db/DatabaseLock: add ScopeDatabaseLock::unlock()
2015-12-16 00:07:51 +01:00
Max Kellermann
c513478c31
db/simple: use StringAfterPrefix() instead of StringStartsWith()
2015-11-11 15:27:56 +01:00
Max Kellermann
e7ef7f5159
db/update/InotifyQueue: use StringAfterPrefix()
2015-11-06 09:49:39 +01:00
Max Kellermann
c880099deb
util/StringCompare: add StringIsEmpty()
2015-11-06 09:37:07 +01:00
Max Kellermann
733989a284
util/StringUtil: move comparison functions to StringCompare.cxx
2015-11-06 09:20:18 +01:00
Max Kellermann
8d23706354
util/DeleteDisposer: new utility class
2015-10-19 15:57:30 +02:00
Max Kellermann
356c829b76
util/StringView: new utility class
2015-09-30 22:21:46 +02:00
Anthony DeRossi
6b6c7b0920
update: apply .mpdignore matches to subdirectories
...
Wildcard matches are directly applied to all filenames in
subdirectories without any attempt at matching relative paths.
This change is based on the following feature request:
http://bugs.musicpd.org/view.php?id=3729
2015-09-30 21:50:34 +02:00
Max Kellermann
f0b58c6f24
db/UniqueTags, tag/Set, ...: use typedef tag_mask_t
2015-08-24 11:53:30 +02:00
Max Kellermann
2f5106c97f
tag/Settings: convert to C++
2015-08-24 11:20:45 +02:00
Max Kellermann
60c077c790
tag/Settings: add function IsTagEnabled() wrapping access to ignore_tag_items[]
2015-08-24 11:20:45 +02:00
Max Kellermann
7652a2986b
client/Response: new Client wrapper class for writing responses
2015-08-12 08:41:05 +02:00
Max Kellermann
eb86fdfbea
SongFilter: return "const char *" instead of std::string
2015-06-25 23:15:36 +02:00
Max Kellermann
0b41faec89
db/update/ExcludeList: remove obsolete TODO comments
2015-06-22 22:12:08 +02:00
Max Kellermann
50eac9b49e
db/update/ExcludeList: move class Pattern to fs/Glob.hxx
2015-06-22 22:12:08 +02:00
Max Kellermann
cd1148c6aa
db/update/ExcludeList: use the NarrowPath class
2015-03-25 17:32:17 +01:00
Max Kellermann
b31d171ae8
*: doxygen fixups
2015-03-17 11:21:43 +01:00
Max Kellermann
39c9669445
fs/Traits: add macro PATH_LITERAL()
2015-03-05 08:58:04 +01:00
Max Kellermann
a9a6a5041b
db/Configured: convert path to UTF-8 before injecting into configuration
2015-03-05 08:38:50 +01:00
Max Kellermann
1c90b0c19d
*: change C-style prototypes, drop "(void)"
2015-03-03 20:05:08 +01:00
Max Kellermann
40a587bbaf
system/FileDescriptor: new wrapper class for a file descriptor
2015-03-03 17:14:30 +01:00
Max Kellermann
ef5090c397
db/update/Container: convert vtrack name to FS charset
2015-03-03 13:20:43 +01:00
Max Kellermann
cf073de36c
storage/local: convert mangled URI to FS charset
2015-03-03 13:18:15 +01:00
Max Kellermann
605af61a0f
db/simple: eliminate UpdateFileInArchive() if archive API is disabled
...
Reduce some unnecessary overhead.
2015-03-01 00:25:30 +01:00
Max Kellermann
90a61b6bab
fs/FileInfo: new library providing GetFileInfo()
...
Replaces StatFile(), with a portable data object.
2015-02-28 23:00:26 +01:00
Max Kellermann
2d06a8e880
storage/FileInfo: rename to StorageFileInfo
2015-02-28 23:00:26 +01:00
Max Kellermann
4dd861ee23
fs/FileSystem: merge CheckAccess() into PathExists()
...
PathExists() should better do what CheckAccess() does, and
CheckAccess() doesn't do what its name implies.
2015-02-27 19:13:46 +01:00
Max Kellermann
fe1e467a49
db/ExcludeList: use the TextFile class instead of stdio.h
2015-02-25 16:25:26 +01:00
Max Kellermann
3d446d3266
lib/upnp/Discovery: apply naming convention
2015-02-02 21:12:19 +00:00
Max Kellermann
557bee61d5
Merge branch 'v0.19.x'
2015-01-29 22:55:18 +01:00
Max Kellermann
3adca3c2fa
db/update/Walk: use std::unique_ptr instead of std::auto_ptr
...
std::auto_ptr is deprecated, and std::unique_ptr is much better
anyway.
2015-01-29 08:37:23 +01:00
Max Kellermann
4fa5538e2b
config/Param: split block-specific attributes to new struct ConfigBlock
...
The old struct config_param remains only for top-level string options.
2015-01-21 23:56:33 +01:00
Max Kellermann
1c3f5517fa
config/Option: convert to strictly-typed enum
2015-01-21 23:30:00 +01:00
Max Kellermann
fe85fa3bea
ConfigData: move struct config_param to Param.hxx
2015-01-21 21:23:02 +01:00
Joshua Wise
1d8544ef3b
db/plugins/ProxyDatabasePlugin: add "keepalive" parameter
2015-01-15 14:44:55 -08:00
Max Kellermann
712ed555e6
Copyright year 2015
2015-01-01 19:48:13 +01:00
Max Kellermann
412bedb697
Merge branch 'v0.19.x'
2014-12-26 14:40:32 +01:00
Max Kellermann
163597ef69
db/simple: fix implicit nullptr/bool conversion
...
Return false on error, not nullptr.
2014-12-26 14:34:03 +01:00
Max Kellermann
95f84afd33
fs/Traits, ...: work around -Wtautological-pointer-compare
...
New in clang 3.6.
2014-12-26 14:34:03 +01:00
Max Kellermann
9f7fd1fbfb
db/lazy, input/mms: add "override" keywords
...
Fixes -Winconsistent-missing-override (clang 3.6).
2014-12-26 14:29:29 +01:00
Max Kellermann
940cab8620
Merge branch 'v0.18.x' into v0.19.x
2014-12-26 14:28:52 +01:00
Max Kellermann
665031467a
db/proxy, output/shout: fix implicit nullptr/bool conversion
...
Return false on error, not nullptr.
2014-12-26 13:50:54 +01:00
Max Kellermann
df33171107
db/{simple,proxy}, ...: add "override" keywords
...
Fixes -Winconsistent-missing-override (clang 3.6).
2014-12-26 13:47:04 +01:00
Max Kellermann
88b75b57d0
playlist, InotifySource, ...: update GLib comments
2014-12-04 23:33:08 +01:00
Max Kellermann
d93172bee8
Compiler.h: add macro CLANG_OR_GCC_VERSION()
2014-11-28 19:09:56 +01:00
Max Kellermann
2e7153d8d6
DatabasePrint: cast int to unsigned before comparison
...
Fixes compiler warning.
2014-11-26 08:21:55 +01:00
Max Kellermann
b3f5b4932c
configure.ac: add macro MPD_ENABLE_AUTO_PKG
...
Simplify the definition of many build options.
2014-11-21 22:19:57 +01:00
Max Kellermann
f37481f843
DatabaseCommands: add "window" parameter to "search"/"find"
2014-11-18 14:31:27 +01:00
Max Kellermann
c3f6502be2
release v0.19.3
...
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQIcBAABAgAGBQJUYeOEAAoJECNuiljG20USToUP/2g/M7jKlM1MpADeFh2TOYEC
dnSDPFCMosu1Hjxyz/rzwqOh7FlMnYPtANtVn90v4D6XVkuhv5WMwSnlMBWJXspy
VWA6bewGihbWvDvOcLcYsb31VH78JnvNjxxDaeakVZ7Bq43wQBJRNi2VKEKMmg27
Shp8MUL+UXsMMtLABvZlhajPQS+CNQB1DijP7wlemrbPpmUtmeHEgbpmQk9BKBq0
eXJt5QRQRgI9J51j1yaXSaeKsPFk/2AV36KMBv3kh+rgCGWetd1XeBkknN/HjNw4
2qWsQ8Ng3s/kOCZhEa0nXqnR+w2RtpOJ4bOQaIDeBSzCdXSeDWq5yh/kHKHsXzO4
5uq++GwCcm/Odwj17rJ4wJDGnl4DkP8abQIPb4AiwfpuUtQ+fHvQuNU0Dc2SY4Oz
KkNU4nIcJwaHlDAQDsWjowAJJC2W0GPSGzVKCWjH2W3kmJZq2hV3o3y3YOMH8gpN
wmdmqE8JKCOJm5QxnfoiMKoUxUgNMxN3iceMnDkNqz/g1uOq5TUk8B5adLuY0OSg
n+2eDBaUNe2tCbxgIeKxVlXrWVBZyrzwFk3FGyVuGhobmVJ1Wwvx5kOIVvwo0JTC
LSc8FP4R8/87G1XlVMo0alqChLpXbH+ncaGhdN74pKVP8TFtJCoTPgRPj+svF9YY
A7AiNXCXCCOD78gKYCtu
=GH2D
-----END PGP SIGNATURE-----
Merge tag 'v0.19.3'
2014-11-11 11:43:52 +01:00
Max Kellermann
0120f396ac
db/upnp/Directory: TitleToPathSegment() returns rvalue reference
...
Eliminate one implicit std::string copy.
2014-11-09 20:46:32 +01:00
Max Kellermann
231fffe594
db/upnp/Directory: apply coding style
2014-11-09 20:40:05 +01:00
Max Kellermann
cbf79769d3
db/Count: include cleanup
2014-11-08 19:21:42 +01:00
Max Kellermann
e67afc35b8
db/upnp/Directory: move checkobjok() to class UPnPDirObject
2014-11-08 10:55:59 +01:00
Max Kellermann
5e73007b1d
db/upnp/Object: apply coding style
2014-11-08 10:52:35 +01:00
Max Kellermann
ccb13205f4
db/upnp: fix valgrind warning
2014-11-07 19:12:43 +01:00
Max Kellermann
464767c5fd
db/upnp/Util: move caturl() to util/UriUtil.cxx
2014-10-10 22:43:40 +02:00
Max Kellermann
89f9561d10
storage/Interface: include cleanup
2014-10-01 23:38:17 +02:00
Wieland Hoffmann
5525ea45a4
Add MusicBrainz' Release Track Id tag
...
The Release Track Id uniquely identifies a recording on a release - that
is, even if a recording appears twice on a release (meaning that the
combination of recording and release id are not enough to figure out
which one it is), the release track id will allow differentiating the two.
The tag names are taken from
https://musicbrainz.org/doc/MusicBrainz_Picard/Tags/Mapping
2014-09-27 19:54:12 +02:00
Max Kellermann
eeb8d0dbcd
db/proxy: support empty values in VisitUniqueTags()
...
Workaround for assertion failure in PrintUniqueTag().
2014-09-18 17:22:31 +02:00
Max Kellermann
b373c53ce4
*: add missing Compiler.h includes
...
Necessary for "final" on gcc 4.6.
2014-08-30 00:46:52 +02:00
Max Kellermann
eebd03701a
db/simple: fix build failure without zlib
2014-08-30 00:25:12 +02:00
Max Kellermann
58352ea69d
db/Stats: use std::chrono::duration for the total duration
...
Use milliseconds precision to reduce rounding errors.
2014-08-29 23:25:03 +02:00
Max Kellermann
de64b35359
db/upnp: use DatabaseStats::Clear()
2014-08-29 23:24:49 +02:00
Max Kellermann
7df8e1eab2
db/Count: use std::chrono::duration for the total time
...
Use milliseconds precision to reduce rounding errors.
2014-08-29 23:18:40 +02:00
Max Kellermann
7c25d83f1c
Tag: use SignedSongTime for the song duration
2014-08-29 13:20:58 +02:00
Max Kellermann
888ab0c89c
db/simple/Song: use std::chrono::duration for start_ms and end_ms
2014-08-28 13:03:18 +02:00
Max Kellermann
2efd8ef52d
db/LightSong: use std::chrono::duration for start_ms and end_ms
2014-08-28 13:03:18 +02:00
Max Kellermann
6ad933982f
DetachedSong: use std::chrono::duration for start_ms and end_ms
2014-08-28 13:03:18 +02:00
Max Kellermann
43f964e28d
db/simple: check for I/O errors in Load()
2014-08-11 22:54:46 +02:00
Max Kellermann
2e122e1509
db/simple: compress the database file using gzip
2014-08-11 21:48:25 +02:00
Max Kellermann
aa2e4d92e0
fs/io/BufferedReader: new class to replace class TextFile
...
The new class is pluggable, to prepare for gzipped database files.
For now, the TextFile class remains, and will be refactored away
later.
2014-08-07 19:38:25 +02:00
Max Kellermann
aafff8fd5c
fs/output, fs/TextFile: move to fs/io/
2014-08-07 19:38:25 +02:00
Max Kellermann
1f3d3970f6
db/update/InotifySource: remove FifoBuffer
...
Eliminate support for partial reads. The Linux kernel will never
return partial results, so this buffering was unnecessary.
2014-08-06 17:20:03 +02:00
Max Kellermann
9fb351a139
*Save, *State: use the OutputStream API instead of FILE*
2014-07-30 22:17:01 +02:00
Max Kellermann
12b5494906
db/proxy: implement Update()
2014-07-29 23:35:09 +02:00
Max Kellermann
aa0f06d6b7
db/Interface: add virtual method Update()
...
For database plugins that don't use the UpdateService.
2014-07-29 23:31:27 +02:00
Max Kellermann
41a7203c28
Tag: add class const_iterator and methods begin(), end()
...
Enables using range-based "for".
2014-07-12 17:22:39 +02:00
Max Kellermann
fa1fb47d75
Merge branch 'v0.18.x'
2014-06-23 10:13:50 +02:00
Max Kellermann
848ed14788
db/proxy: fall back to recursive walk on old libmpdclient/MPD
...
Error message was 'too few arguments for "find"' because the "base"
constraint was not supported, and no other constraints remained.
2014-06-23 09:18:11 +02:00
Max Kellermann
4c8a5dfb05
db/proxy: use mpd_song_get_{start,end}() only with libmpdclient >= 2.3
2014-06-23 09:17:35 +02:00
Max Kellermann
b9eeb6e6eb
db/proxy: use mpd_song_get_{start,end}() only with libmpdclient >= 2.3
2014-06-23 08:57:51 +02:00
Max Kellermann
936eb43c0e
db/proxy: initialize LightSong::real_uri
...
Fixes potential crash.
2014-06-21 12:37:23 +02:00
Max Kellermann
fefb35c782
Directory: eliminate attribute "have_stat"
...
Check for 0 in "device" and "inode" instead.
2014-06-16 19:46:35 +02:00
Max Kellermann
3ca0a39a35
db/simple: use class boost::intrusive::list
...
Remove the C list_head library and use type-safe C++ instead.
2014-06-16 18:39:16 +02:00
Max Kellermann
bc2a1160b8
db/Count: implement grouping
2014-04-27 22:27:43 +02:00
Max Kellermann
75542e8f5d
db/Count: add constructor
2014-04-27 22:27:28 +02:00
Max Kellermann
fcb55f841a
DatabasePrint: move PrintSongCount() to Count.cxx
2014-04-26 22:59:21 +02:00
Max Kellermann
154e601f4e
db/Helpers: split library
2014-04-25 18:39:21 +02:00
Max Kellermann
4cca75b2e1
DatabasePrint: refactor variable/function names
2014-04-25 18:36:07 +02:00
Max Kellermann
ecc12c9ba1
db/Helpers: move code to tag/Set.cxx
2014-04-24 18:32:23 +02:00
Max Kellermann
9e50993c13
db/Helpers: move TagSet to dedicated header
2014-04-24 18:18:26 +02:00
Max Kellermann
b32ec857b1
db/Helpers: use set::emplace()
2014-04-24 18:17:07 +02:00
Max Kellermann
0de42d56fc
DatabasePrint: eliminate printAllIn(), printInfoForAllIn()
2014-04-24 18:09:39 +02:00
Max Kellermann
6378ad69bb
DatabasePrint: merge adjacent client_printf() calls
2014-04-24 18:07:12 +02:00
Max Kellermann
9616e9bf3b
DatabasePrint: pass const SearchStats reference
2014-04-24 18:06:46 +02:00
Max Kellermann
7c8b73bffb
DatabasePrint: use unsigned counts
2014-04-24 18:06:26 +02:00
Max Kellermann
ae178c77bd
DatabaseCommands: "list" allows grouping
2014-04-24 11:38:49 +02:00
Max Kellermann
27002ad1ea
db/Helpers: "list" on album artist falls back to the artist tag
2014-04-24 10:48:52 +02:00
Max Kellermann
986dd2fac1
db/Helpers: move code to CheckUniqueTag()
2014-04-24 10:47:53 +02:00
Max Kellermann
3965b490a9
db/Helpers: use reference instead of pointer
2014-04-24 10:31:19 +02:00
Max Kellermann
c9aec3e866
DatabaseCommands: fix crash on "list base"
...
The string "base" is understood by locate_parse_type(), but not by
listAllUniqueTags(). The special tag type LOCATE_TAG_BASE_TYPE causes
a crash in PrintUniqueTag().
2014-04-24 08:19:08 +02:00
Max Kellermann
1d1f8be260
DatabasePrint: convert "type" to unsigned
2014-04-24 08:18:41 +02:00
Max Kellermann
f2f1801c25
db/proxy: check connect error before initializing SocketMonitor
...
Fixes crash bug because mpd_connection_get_async() was called without
a connection.
2014-03-06 13:35:42 +01:00
Max Kellermann
36ca57a54e
fs/StandardDirectory: add GetUserCacheDir()
...
Move code from CreateConfiguredDatabase() and add XDG support. This
implements an automatic Linux fallback for the setting "db_file" if
none was specified.
2014-03-01 22:51:51 +01:00
Max Kellermann
b8f1850bba
db/Configured: store database file in cache directory
...
Add class Context which wraps the Android/Java Context class and add a
JNI wrapper for method Context.getCacheDir().
2014-03-01 22:20:28 +01:00
Max Kellermann
7ccc609da2
db/update/ExcludeList: make no-op if GLib is disabled
...
Quick hack to allow using the database without GLib (for Android).
2014-03-01 08:16:13 +01:00
Max Kellermann
96afa8bd2b
command: add command "listfiles"
...
Lists files and directories. Supports storage plugins.
2014-03-01 06:25:57 +01:00
Max Kellermann
20cdab5546
DatabasePrint: move code to PrintDirectoryURI()
2014-02-28 08:21:34 +01:00
Max Kellermann
6765234b60
DatabasePrint: add API documentation
2014-02-28 08:17:25 +01:00
Max Kellermann
e9a85aa4e4
db/simple: mount points
...
A SimpleDatabase instance can now "mount" other Database instances at
certain locations. This is used to use a new SimpleDatabase instance
for each storage mount (issued with the "mount" protocol command).
Each such instance has its own database file, stored in the directory
that is specified with the "cache_directory" option.
2014-02-27 20:49:13 +01:00
Max Kellermann
f65254680a
db/update/Queue: use std::list instead of std::queue
...
The problem with std::queue is that it doesn't give us enough control.
The method Clear() is a kludge already, but soon, we'll need
filtering.
2014-02-27 20:49:13 +01:00
Max Kellermann
d64edb6896
db/simple: GetRoot() returns reference
2014-02-27 19:29:10 +01:00
Max Kellermann
3f9ad8e104
db/update/Service: allocate UpdateWalk dynamically
2014-02-27 18:04:24 +01:00
Max Kellermann
1c772ef699
Playlist: use the Error library to return errors
2014-02-27 17:27:23 +01:00
Max Kellermann
681e012fb5
db/update: cancel the update on shutdown
2014-02-27 16:58:35 +01:00
Max Kellermann
3be36643a1
db/UpdateGlue: rename to Service.cxx
2014-02-27 16:14:10 +01:00
Max Kellermann
21e19ef69f
db/simple/Directory: eliminate method LookupSong()
...
Move to SimpleDatabase::GetSong() to give that method more control.
2014-02-26 20:10:31 +01:00
Max Kellermann
69a42fc901
db/simple/Directory: LookupDirectory() return remaining URI
...
Code can now be reused in LookupSong().
2014-02-26 19:50:46 +01:00
Max Kellermann
525789cd36
db/simple/Directory: make variables more local
2014-02-26 19:50:36 +01:00
Max Kellermann
367d660c08
db/Directory: add DEVICE_* documentation
2014-02-26 10:00:38 +01:00
Max Kellermann
4d73e4d605
db/simple: create dedicated directory
2014-02-26 09:17:41 +01:00
Max Kellermann
d86cc5bf42
db/Song: update API documentation for SimpleDatabasePlugin
2014-02-25 22:16:20 +01:00
Max Kellermann
5f262da09d
db/simple: remove unused method LookupDirectory()
2014-02-25 20:13:40 +01:00
Max Kellermann
82985a9488
db/simple: make internal methods "private"
2014-02-25 19:48:01 +01:00
Max Kellermann
afcdb65f80
db/simple: add comment
2014-02-25 18:17:54 +01:00
Max Kellermann
6b66e86f40
db/simple: move Create() up
2014-02-25 18:17:39 +01:00
Max Kellermann
cb145d290e
DirectorySave: save the flags "DEVICE_INARCHIVE" and "DEVICE_CONTAINER"
...
Helps avoid unnecessary archive scans during database update on a
fresh MPD process.
2014-02-25 18:16:19 +01:00
Max Kellermann
167803d2a1
DatabaseSave: increase DB_FORMAT version
2014-02-25 18:16:06 +01:00
Max Kellermann
58a981d2f6
DatabaseSave: add constant OLDEST_DB_FORMAT
2014-02-25 18:15:55 +01:00
Max Kellermann
8963cd1fab
DirectorySave: move code to ParseLine()
2014-02-25 18:15:43 +01:00
Max Kellermann
55cd5a9a78
DirectorySave: save the mtime only if it is known
2014-02-24 21:17:06 +01:00
Max Kellermann
33fc3af775
SongSort, ...: use libicu instead of GLib's g_utf8_*()
2014-02-24 20:39:37 +01:00
Max Kellermann
25431f32a2
DecoderPlugin: free the container_scan() return value with delete[]
2014-02-24 20:19:34 +01:00
Max Kellermann
09e5f17b5d
Directory: use PathTraitsUTF8::Build() instead of g_strconcat()
2014-02-23 22:02:39 +01:00
Max Kellermann
db20e29af6
Directory: pass std::string&& to constructor
2014-02-23 22:02:02 +01:00
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
Max Kellermann
4b044bd8e1
InotifyUpdate: pass EventLoop to mpd_inotify_init()
2014-01-29 18:36:32 +01:00
Max Kellermann
a137f817f5
db/Directory: move isRootDirectory() to Uri.hxx
...
Decouple command/OtherCommands.cxx from the "simple" database plugin.
2014-01-29 18:05:33 +01:00
Max Kellermann
f548a966f5
Playlist{Info,Vector}: move to db/
2014-01-27 11:05:21 +01:00
Max Kellermann
3dad837ca6
db/upnp: remove sleep(2) call
...
This call was unnecessary. It is a bad idea anyway to block the MPD
process for some arbitrary amount of time.
2014-01-26 15:50:30 +01:00
Max Kellermann
d7e78059b0
upnp: initialize the client handle only once
...
Eliminate class LibUPnP and move the code to ClientInit.cxx. Its
initialization function can be called multiple times, but
UpnpRegisterClient() is called at most once.
2014-01-26 15:43:23 +01:00
Max Kellermann
e57e89b9d5
upnp/discovery: use a plain UpnpClient_Handle instead of class LibUPnP
2014-01-26 15:22:33 +01:00
Max Kellermann
f86f5ad224
db/upnp: move generic code to lib/upnp/
2014-01-26 13:41:40 +01:00
Max Kellermann
4a3dc2cea2
db/upnp: rename variables
2014-01-26 13:08:52 +01:00
Max Kellermann
97391fd4b9
DespotifyUtils, Expat: move to lib/
2014-01-24 16:44:36 +01:00
Max Kellermann
9d34fc394c
Database*: move to db/
2014-01-24 16:38:44 +01:00
Max Kellermann
197b503f3e
Config*: move to config/
2014-01-24 00:20:01 +01:00
Max Kellermann
b8e382b011
db/upnp/Discovery: use std::list instead of std::map
...
There will only be very few items, and that does not justify the bloat
of std::map.
2014-01-23 22:35:22 +01:00
Max Kellermann
c9af358e4b
db/upnp/Discovery: move code to LockAdd(), LockRemove()
2014-01-23 22:35:22 +01:00
Max Kellermann
3afcfe3330
db/upnp/Discovery: un-inline the destructor
2014-01-23 22:35:22 +01:00
Max Kellermann
f3f5e2e162
db/upnp: un-inline a few destructors
...
Reduce bloat.
2014-01-23 21:17:40 +01:00
Max Kellermann
b52d8fbebe
db/upnp: strict vpath checks for the "root" directory
2014-01-23 00:40:39 +01:00
Max Kellermann
b61a2c722c
db/upnp: move code to VisitObject()
2014-01-23 00:28:27 +01:00
Max Kellermann
c455d2c1de
db/upnp: merge two PathTraitsUTF8::Build() calls
2014-01-23 00:25:08 +01:00
Max Kellermann
77070f5ab9
db/upnp: move code to VisitItem()
2014-01-23 00:17:38 +01:00
Max Kellermann
8d5f7160ac
db/upnp: fix subdirectory paths in "listallinfo"
...
Add missing server name prefix.
2014-01-23 00:07:35 +01:00
Max Kellermann
b167ce2913
base_uri
2014-01-23 00:06:17 +01:00
Max Kellermann
3ac15ca8d1
db/upnp: pass char* to visitSong()
...
Don't use std::string, reduce bloat.
2014-01-23 00:06:03 +01:00
Max Kellermann
f703d4fc3e
db/upnp: call VisitDirectory on servers, even in recursive mode
2014-01-22 23:52:08 +01:00
Max Kellermann
77c461fed7
db/upnp: make several methods "const"
2014-01-22 23:50:33 +01:00
Max Kellermann
a89c21b06a
db/upnp: inline Configure()
2014-01-22 23:30:53 +01:00
Max Kellermann
b74aa6b14c
db/upnp: don't duplicate song data for VisitSong
...
Not necessary because we control the LightSong's life cycle.
2014-01-22 23:28:23 +01:00
Max Kellermann
0c4a791111
db/upnp: emplace/move in csvToStrings()
2014-01-22 23:21:23 +01:00
Max Kellermann
1feedd4d9c
db/upnp: require an empty token list in csvToStrings()
2014-01-22 23:21:14 +01:00
Max Kellermann
0ec1808956
db/proxy: simplify csvToStrings()
2014-01-22 23:17:42 +01:00
Max Kellermann
546e7cafa4
db/proxy: merge redundant string::push_back() calls
2014-01-22 23:13:24 +01:00
Max Kellermann
d9926a1c21
db/upnp: use PathTraitsUTF8::Build()
2014-01-22 23:10:00 +01:00
Max Kellermann
e50969e31c
db/proxy: fix for libmpdclient < 2.9
2014-01-22 23:09:36 +01:00
Max Kellermann
a6d9998e1d
db/proxy: copy "Last-Modified" from remote directories
2014-01-22 23:07:21 +01:00
Max Kellermann
a42f9e4ee3
LightDirectory: new struct replacing Directory in the DB API
2014-01-22 23:01:32 +01:00
Max Kellermann
4943606f4a
db/upnp: append characters instead of single-character strings
2014-01-22 21:55:58 +01:00
Max Kellermann
87629dda81
db/upnp: use string::push_back() instead of string::append()
2014-01-22 21:55:08 +01:00
Max Kellermann
71928b473e
db/upnp/Discovery: unlock mutex before deleting DiscoveredTask
2014-01-22 21:48:33 +01:00
Max Kellermann
a0bee9fa0a
db/upnp/Discovery: eliminate two strlen() calls
2014-01-22 21:47:34 +01:00
Max Kellermann
0defd927f3
db/upnp: use std::list instead of std::set for SearchCapabilities
...
Reduce bloat. We never used the set lookup.
2014-01-22 21:41:05 +01:00
Max Kellermann
6c41e8f63f
db/upnp: check offset<total at end of loop
2014-01-22 21:37:21 +01:00
Max Kellermann
fa67a4e956
db/upnp: break when zero objects have been returned
2014-01-22 21:37:19 +01:00
Max Kellermann
bf9352fb26
db/upnp: free responses manually
2014-01-22 21:33:54 +01:00
Max Kellermann
7573d4e1ba
db/upnp: break when count==0
...
Make this non-fatal. Just stop reading more objects.
2014-01-22 21:33:19 +01:00
Max Kellermann
bfb483898f
db/upnp: use ParseUnsigned() instead of atoi()
2014-01-22 21:11:04 +01:00
Max Kellermann
f363788d76
db/upnp: pass unsigned integers to readDirSlice()
2014-01-22 20:57:10 +01:00
Max Kellermann
714056f157
db/upnp: inline ContentDirectoryService::readDirSlice()
2014-01-22 20:42:36 +01:00
Max Kellermann
1abc96fa27
db/upnp: remove special case for "*"
...
Passing this to csvToStrings() will do the same.
2014-01-22 20:37:17 +01:00
Max Kellermann
0fa98479ad
db/upnp: obtain char* from ixmlwrap::getFirstElementValue()
...
Fixes crash when there's no SearchCaps element.
2014-01-22 20:26:33 +01:00
Max Kellermann
02f2171010
db/upnp/Util: pass char* to csvToStrings()
2014-01-22 20:24:55 +01:00
Max Kellermann
a5e7d0a90f
db/upnp: require an empty input capability set
2014-01-22 20:21:01 +01:00
Max Kellermann
9fb5134f64
db/upnp/Util: handle absolute URI paths properly in caturl()
...
Fixes problems with some UPnP servers.
2014-01-22 19:38:07 +01:00
Max Kellermann
9aeb23dfe9
db/upnp/Util: use string::back(), string::front()
2014-01-22 19:38:02 +01:00
Max Kellermann
e59d8c9378
db/upnp/Device: clear the "value" pointer on unknown element
...
Avoid appending to an obsolete string object.
2014-01-22 19:38:02 +01:00
Max Kellermann
9747cc9e58
db/upnp/Device: replace std::vector with a std::string pointer
2014-01-22 09:55:51 +01:00
Max Kellermann
7b44dea4b1
db/upnp/Device: remove unused UPnPService attributes
2014-01-22 09:51:26 +01:00
Max Kellermann
18aea922e9
db/upnp/Directory: "emplace" items into the vector
2014-01-22 09:43:49 +01:00
Max Kellermann
7d194aceb6
db/upnp/Device: emplace/move the UPnPService into the vector
...
Reduce overhead.
2014-01-22 09:42:46 +01:00
Max Kellermann
2722b8a3df
db/upnp/Util: "emplace" items into the list
...
Reduce overhead.
2014-01-22 09:40:38 +01:00
Max Kellermann
fd754ff8f8
db/upnp/Directory: replace std::vector with a simple enum
...
Reduce bloat.
2014-01-22 09:32:11 +01:00
Max Kellermann
b7738e7af3
db/upnp/Directory: join all CDATA nodes for tag values
...
Expat can call CharacterData() multiple times if the CDATA contains
entity references. We need to collect all of them in one large
string.
2014-01-22 08:44:35 +01:00
Max Kellermann
99bebabac9
db/upnp/Directory: make "m_dir" private
2014-01-22 08:44:20 +01:00
Max Kellermann
0ed48b364a
db/upnp: merge duplicate branches in Namei()
2014-01-21 23:42:02 +01:00
Max Kellermann
b38b8b9c18
db/upnp: simplify Namei()
2014-01-21 23:37:27 +01:00
Max Kellermann
5434856136
db/upnp: use std::list instead of std::vector
...
Reduce overhead.
2014-01-21 23:33:28 +01:00
Max Kellermann
aa1eb2f40d
db/upnp: use iterator in Namei()
2014-01-21 23:32:42 +01:00
Max Kellermann
7260d7883c
db/upnp: move "objid" declaration down
...
Don't allocate the object when it's not needed.
2014-01-21 23:10:30 +01:00
Max Kellermann
154250f551
db/upnp: eliminate redundant Namei() parameter "oobjid"
...
The caller should better obtain the object id from the returned
UPnPDirObject instance.
2014-01-21 23:07:33 +01:00
Max Kellermann
3e4fb92cfb
db/upnp: remove redundant objid.empty() check from VisitServer()
...
If Namei() succeeds, the object id is guaranteed to be set.
2014-01-21 23:07:06 +01:00