Commit Graph

949 Commits

Author SHA1 Message Date
jcorporation
2937a55582 add precondition for mount/unmount in commands response 2022-10-07 13:59:54 +02:00
Max Kellermann
cc0def15c4 Copyright year 2022 2022-07-14 17:59:35 +02:00
Max Kellermann
cddeb2a0df io/BufferedOutputStream: add missing #include 2022-07-13 14:11:36 +02:00
Max Kellermann
b52b0ac85a *: use BufferedOutputStream::Fmt() 2022-07-13 13:10:14 +02:00
Max Kellermann
b9c9a5f1dd db/*: use std::span instead of ConstBuffer 2022-07-04 18:37:35 +02:00
Max Kellermann
23235e3194 db/upnp/Directory: use std::string_view instead of StringView 2022-07-04 14:50:18 +02:00
Max Kellermann
93834fe389 db/simple/Directory: use std::string_view instead of StringView 2022-07-04 14:50:18 +02:00
Max Kellermann
171b31ae67 lib/zlib/GzipOutputStream: rename Flush() to Finish() 2022-07-04 10:08:54 +02:00
Max Kellermann
96f99aeb8f TagPrint: use std::string_view 2022-07-01 11:29:58 +02:00
Max Kellermann
60ca12e4bd db/simple/Song: use std::string_view 2022-06-30 21:04:13 +02:00
Max Kellermann
0f4bf5569a event/InotifyEvent: new class wrapping inotify
Replaces class InotifySource.
2022-06-30 12:05:50 +02:00
Max Kellermann
d256d3dabe util/StringCompare: use std::string_view instead of StringView 2022-05-31 13:24:45 +02:00
Max Kellermann
166ce0da5a db/VHelper: move CompareTags() to tag/Sort.cxx 2022-02-14 12:37:05 +01:00
Max Kellermann
edbaea8df2 db/Selection: refactor IsEmpty() to IsFiltered() 2022-02-14 09:21:32 +01:00
Max Kellermann
ad4cf79cc9 tag: new tag "Mood"
Closes https://github.com/MusicPlayerDaemon/MPD/issues/1435
2022-02-12 07:50:18 +01:00
Max Kellermann
a5fa43b526 fs/io: move to io/ 2021-12-03 14:35:41 +01:00
Max Kellermann
8681a3d74c replace TextFile references with LineReader 2021-12-03 14:22:56 +01:00
Rosen Penev
e03f82636a const reference conversion
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-11-23 12:33:03 -08:00
Rosen Penev
d53d85bd79 remove unused includes
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-11-23 12:33:03 -08:00
Rosen Penev
250011f016 return by braced init list
shorter

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-11-22 23:28:08 -08:00
Max Kellermann
dcb5ca203c db/DatabasePlaylist: increment only one variable
Fixes "searchaddpl" bug emitting bogus error "Bad position".

Closes https://github.com/MusicPlayerDaemon/MPD/issues/1338
2021-11-22 20:47:34 +01:00
Max Kellermann
77df5a8f24 lib/pcre: migrate to PCRE2
Closes https://github.com/MusicPlayerDaemon/MPD/issues/1352
2021-11-22 19:32:45 +01:00
Rosen Penev
4e0e4c00bf treewide: replace lock_guard with scoped_lock
SonarLint reports the latter to be better:

std::scoped_lock basically provides the same feature as std::lock_guard,
but is more generic: It can lock several mutexes at the same time, with a
deadlock prevention mechanism (see {rule:cpp:S5524}). The equivalent code
to perform simultaneous locking with std::lock_guard is significantly more
complex. Therefore, it is simpler to use std::scoped_lock all the time,
even when locking only one mutex (there will be no performance impact).

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-11-11 17:13:03 -08:00
Max Kellermann
3464497880 command/database: add optional position parameter to "searchaddpl"
Closes https://github.com/MusicPlayerDaemon/MPD/issues/1328
2021-11-11 09:52:49 +01:00
Max Kellermann
651f57bced command/playlist: save only if at least one song was added 2021-11-11 09:50:31 +01:00
Max Kellermann
b4e72aba6c command/playlist: move code to SearchInsertIntoPlaylist() 2021-11-11 09:40:41 +01:00
Max Audron
6f81bb4b09 upnp: add option to configure interface for db plugin
Add an option to the UPnP database plugin to configure which interface
is used by upnp to discover servers.

upnp by default selects the first interface that is not loopback, which
in some cases might not be the desired interface. For example if wanting
to access a DLNA server over a VPN connection.

The "interface" option can now be set to the name of the desired
interface to achieve this.

The default behaviour remains unchanged.
2021-11-08 23:04:07 +01:00
Max Audron
4ed60a5711 upnp: expose interface configuration on UpnpInit2()
Adds the Interface Name as an argument to the *Init functions to make it
possible to select which interface is used by upnp to detect servers.

Currently "nullptr" is passed in to let the upnp library select an
interface, as before.
2021-11-08 22:53:01 +01:00
Max Kellermann
03f99dd26e db/update/Walk: use GetFilenameSuffix() instead of uri_get_suffix()
Unlike GetFilenameSuffix(), uri_get_suffix() removes the query string
first, which breaks file names with question marks in the name.
Therefore, uri_get_suffix() shall only be applied to remote URIs.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/1316
2021-10-31 13:18:24 +01:00
Max Kellermann
bfb1b641f9 db/update/InotifyUpdate: fix use-after-free bug
Regression by commit 2d8847f428
2021-10-28 13:39:38 +02:00
Max Kellermann
37bd6de658 db/simple: add option to hide CUE target songs
This reduces duplicates in the music database by hiding the original
song file when it is referenced by a CUE sheet.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/1275
2021-10-14 13:28:37 +02:00
Max Kellermann
f7622ca332 db/update/Walk: move PurgeDanglingFromPlaylists() to Playlist.cxx 2021-10-14 13:12:10 +02:00
Max Kellermann
b82b56970b db/simple/Song: reorder fields for better packing 2021-10-14 12:55:02 +02:00
Max Kellermann
efa3ffa8d8 Revert "db/update/playlist: remove non-existent targets while scanning"
This reverts commit 9200fa6d06.  It was
wrong because it works only if the target song has already been
scanned.
2021-10-14 11:50:41 +02:00
Max Kellermann
1b8c94d6b9 db/update/Playlist: move code to another UpdatePlaylistFile() method 2021-10-14 11:36:45 +02:00
Max Kellermann
cd5c1f3f45 db/update/playlist: remove empty playlist directories 2021-10-13 19:23:24 +02:00
Max Kellermann
9200fa6d06 db/update/playlist: remove non-existent targets while scanning 2021-10-13 19:23:24 +02:00
Max Kellermann
2d8847f428 db/update/InotifyUpdate: convert to class, no global variables 2021-10-13 18:47:56 +02:00
Max Kellermann
2fbbd540bb more [[gnu::...]] attributes 2021-10-13 17:38:01 +02:00
Max Kellermann
d2a8b1e8a5 db/update/InotifySource: make errors non-fatal 2021-10-13 16:53:01 +02:00
Max Kellermann
f8cbba1850 util/Alloc: remove unused library 2021-10-13 14:48:16 +02:00
Max Kellermann
f510564d9d more [[gnu::...]] attributes 2021-10-13 12:07:05 +02:00
Max Kellermann
4dae8b41da event/PipeEvent: new class wrapping SocketEvent 2021-10-13 10:45:55 +02:00
Rosen Penev
6ec5089cc9 remove std::make_pair
make_pair is an old C++98 function that can be replaced by modern
shorter constructs.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-09-07 21:13:22 -07:00
Rosen Penev
0b774df375 prevent use after move
These should be equivalent anyway.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-08-26 13:38:36 -07:00
Rosen Penev
0f7a0b04ca replace loop with find_if
loop is wrong anyway. It's missing a break;

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-08-21 00:48:30 -07:00
Max Kellermann
bd893e6336 release v0.22.10
-----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCgAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAmENYHwQHG1heEBtdXNp
 Y3BkLm9yZwAKCRAjbopYxttFEpGtD/9ToU27x36NAAFpChicSqbu3h2wtJ29lowT
 ivV80XB26pQeGK0DSXADSs38MVXo42i3vqg0zGWV9TRbcDs5VErXANVLN16qsKCu
 U0v1BDY11UiYp6ATiUjIahyG1UsmbRVZlfDyVIhYvmFpGLFw6+03HH6w2k/v85ns
 FxyXkYDYcUokPJPEQcChE1eIwKsGM6MjbdVIkJAEo3wGhL/Hhy2KUskrFcCo1PDj
 7xxGrwauG+8wSjAWMA5vzl3udRaDauuXztm5QbQIDdsbRaCiBAdgkzC0PvIxTOr0
 bR4WHVB0KSiM96yIXNtg/WZxO0XrxppmX/E4eZSgz0JGKMrAHcoTJAUCIDu3X719
 gJnJLg7r2X5dTchXezv09YoJolKbw1bOooyAuE4FCDWMsOa2GRuBZC+8w7DNTZuo
 PTh+Z40fnfpNBofe+e/WZrXr6i2TKk8CqHEidq2GHlOkvTR7g6m8MjOLvZNHotMb
 9ECr9MhzXH+nvEX8IaxvjWsfLJiDbUgnVsQ+6akGtkbragaDN/Wgr/XdkELoLlsK
 LZFY5ngnZmDXOu4tjBLJtfrTkZB2/Hld4xtF1qlsy9fvZBRKeKlpABTLaa8r/vnR
 Ta0rB2O3/dculZbHZRUnZvLS4Xv4g322vW9Wso9IBoWRn9fC8b2zR93k7breAqcn
 pKbYGg/j6g==
 =/954
 -----END PGP SIGNATURE-----

Merge tag 'v0.22.10'

release v0.22.10
2021-08-06 18:21:59 +02:00
Max Kellermann
1985786ed2 db/simple: prune CUE entries from database for non-existent songs
Closes https://github.com/MusicPlayerDaemon/MPD/issues/1019
2021-08-05 20:26:21 +02:00
Max Kellermann
8e0d39ae94 db/update/Playlist: prepend "../" only for relative URIs
Prepending "../" to absolute URIs would break them.
2021-08-05 20:19:33 +02:00
Max Kellermann
ef2fc4e6f6 db/simple/Directory: remove obsolete API doc 2021-08-05 19:05:03 +02:00