Commit Graph

1026 Commits

Author SHA1 Message Date
Max Kellermann dcc7628b67 db/update/Archive: remove useless log message 2023-04-30 08:39:34 +02:00
Max Kellermann f2a4ae15aa db/update: pass filenames as std::string_view 2023-04-30 08:28:43 +02:00
Max Kellermann 434bcb08ee db/simple/Song: pass std::string_view to Load{File,FromArchive}() 2023-04-30 08:21:20 +02:00
datasone 838b19c2b5 db/SimpleDatabasePlugin: store in_playlist value of songs into database
Fixes hide_playlist_targets not working after server restart

Currently, `hide_playlists_targets` works by skipping songs with
`in_playlist` value set to true in
[`Directory::Walk`](https://github.com/MusicPlayerDaemon/MPD/blob/a57bcd02382947abbd961594cdf00302c0c7866a/src/db/plugins/simple/Directory.cxx#L237). But
`in_playlist` is not stored and only updated in
[`UpdateWalk::PurgeDanglingFromPlaylists`](https://github.com/MusicPlayerDaemon/MPD/blob/a57bcd02382947abbd961594cdf00302c0c7866a/src/db/update/Playlist.cxx#L139),
which will only be executed while updating DB.

This causes the problem that playlist target songs are correctly
hidden after database update, but will remain visible after mpd server
restarted. This pr solves the problem by storing `in_playlist` value
of songs into the `SimpleDatabase` file.
2023-04-12 05:18:21 +02:00
Max Kellermann 8b77da545d *: use transparent comparison for std::{map,set} with std::string keys
This avoids many std::string temporaries for lookups.
2023-03-12 09:12:02 +01:00
Max Kellermann 5388759bd5 db/proxy: require libmpdclient 2.15 or later 2023-03-10 13:45:37 +01:00
Max Kellermann e927655774 db/proxy: require MPD 0.21 or later 2023-03-10 13:43:49 +01:00
Max Kellermann 815b248990 */Registry: use constinit 2023-03-07 12:04:16 +01:00
Max Kellermann 415de497d3 use more libfmt instead of sprintf() 2023-03-06 19:50:53 +01:00
Max Kellermann b5d224ce22 fs/{StandardDirectory,CheckFile}: move to fs/glue/
Distangle library dependencies.
2023-03-06 19:43:09 +01:00
Max Kellermann 8f41e05a39 db/upnp/ContentDirectoryService: use fmt::format_int 2023-03-06 16:45:59 +01:00
Max Kellermann 42f6a0441c use [[gnu::...]] attributes 2023-03-06 16:14:15 +01:00
Max Kellermann 7a46c57ef3 tag/Type: require C++ 2023-03-06 15:28:44 +01:00
Max Kellermann 118b76a8f1 db/Interface, ...: forward-declare TagType 2023-03-06 15:25:30 +01:00
Max Kellermann a302d34f6d tag/Names: convert to C++ 2023-03-06 15:16:33 +01:00
Max Kellermann 148aca23be use SPDX IDs, replacing the long copyright headers 2023-03-06 14:59:48 +01:00
Max Kellermann 3cc770a00b remove obsolete Boost dependency
Boost makes building a piece of software much more difficult than
necessary.  It's a huge library, and just uncompressing it takes a
considerable amount of time. MPD only used a tiny fraction of it, yet
its header bloat made the MPD build very slow.  Locating Boost was
difficult due to its arcane build system and its resistance to use
pkg-config; it's always a special case.  MPD could never use features
of newer Boost versions because Linux distributions always shipped old
Boost versions.  Boost made everything complicated and slow.

So, finally, after getting rid of GLib (commit ccdb94b06c), switching
to C++ and using Boost (commit 0801b3f495), we've finally get rid of
it 8 years later.

Unfortunately, I had to reimplement parts of it along the way
(e.g. IntrusiveList).  Kind of NIH, but on the other hand, compiling
MPD has become much easier for users.
2023-01-23 15:06:58 +01:00
Max Kellermann fa58db798b lib/fmt/RuntimeError: new library
Replacing FormatRuntimeError().
2022-11-29 14:10:34 +01:00
Max Kellermann 1f33ac3e98 lib/upnp/Error: wrap libupnp errors in std::system_error 2022-11-29 00:32:48 +01:00
Max Kellermann 66029c405f system/FmtError: move to lib/fmt/ 2022-11-28 23:09:27 +01:00
Max Kellermann 96ae659fdf system/FmtError: new library
Replaces the Format*() functions in system/Error.hxx.
2022-11-28 21:56:12 +01:00
Max Kellermann 8fe29f5728 Merge tag 'v0.23.11'
release v0.23.11
2022-11-28 17:00:38 +01:00
Max Kellermann e9f6a3482c db/Configured: add default "cache_directory" setting 2022-11-28 14:24:52 +01:00
Max Kellermann 5d2e80f188 db/Configured: use GetAppCacheDir() instead of GetUserCacheDir() 2022-11-28 14:20:15 +01:00
Max Kellermann fb5d77158a util/IntrusiveList: add enum LinkMode
Compile-time code simplification.
2022-11-13 08:15:47 +01:00
Max Kellermann 0fd4c14043 db/simple/Directory: re-add Song.hxx to fix clang build failure 2022-11-11 19:13:01 +01:00
Max Kellermann 81e1f87e8c db/simple/{Directory,Song}: use IntrusiveList instead of boost::intrusive::list 2022-11-11 19:08:22 +01:00
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