Commit Graph

1026 Commits

Author SHA1 Message Date
Miguel A. Arroyo e3809bd4f0 feat: Add ShowMovement Tag
This commit adds the `SHOWMOVEMENT` [tag](https://picard-docs.musicbrainz.org/en/appendices/tag_mapping.html#show-work-movement-4). Historically, this tag originates from iTunes' MP4, but has since become widely used. It is created by Picard's Classical music [plugins](https://picard-docs.musicbrainz.org/en/variables/variables_classical.html) (such as "Classical Extras" or "Work & Movement").

The reasoning behind this tag is to display Work & Movement titles without redundant information and in a more uniform way. Moreover, it additionally serves as an implicit marker denoting classical music tracks (genre tags aren't sufficient).

If the client so chooses to support this tag, they can display `Work` and `Movement` instead of the track title allowing for cleaner display. Other clients can continue to display the `%title%` as before without any fuss.
2024-07-23 21:09:31 -07:00
Max Kellermann 381215fd73 *: use std::scoped_lock with implicit template parameter 2024-05-23 20:54:49 +02:00
Max Kellermann 6dfdd8c1c2 db/update/Walk: use Storage::OpenFile() 2024-05-17 12:54:08 +02:00
Max Kellermann 1b6c279850 db/update/Paylist: use Storage::OpenFile() 2024-05-17 12:54:08 +02:00
Max Kellermann a701da6386 db/update/InotifyUpdate: use OpenLocalInputStream() 2024-05-15 14:48:32 +02:00
Max Kellermann 67f01fbdb6 db/plugins/simple/Song: pass StorageFileInfo to UpdateFile()
Eliminates a redundant GetInfo() call.
2024-05-07 21:22:39 +02:00
Max Kellermann 164b5b0cf3 db/Song, SongUpdate: remove unnecessary c_str() calls
Just case implicitly to std::string_view, which is both simpler and
safer.
2024-05-07 21:13:38 +02:00
Max Kellermann 0c1ecc96a8 *: let libfmt quote strings 2024-04-16 11:50:18 +02:00
Max Kellermann ae85c2a979 db/Configured: log debug message when there is no cache directory
Closes https://github.com/MusicPlayerDaemon/MPD/issues/1525
2024-04-16 10:57:28 +02:00
Marius Feraru 7b6909f2c0 db/update/Walk:FindAncestorLoop: uint64_t inode & device
Previously, inode numbers were truncated to 32 bits, which could lead
to problems on XFS where inodes are 64 bit; this could lead to bogus
"recursive directory found" errors during database update.

[mk: added commit description and NEWS line]

Closes https://github.com/MusicPlayerDaemon/MPD/issues/2000
2024-03-11 13:34:27 +01:00
Max Kellermann d3335f9947 db/simple: make more fields `const` 2024-01-08 13:55:15 +01:00
Max Kellermann 1a67062e1e db/simple: reorder fields to reduce padding 2024-01-08 13:54:15 +01:00
Max Kellermann fec1a4ac32 db/simple: pass hide_playlist_targets to sub-instance 2024-01-08 13:53:59 +01:00
Max Kellermann 393d57b387 util/NumberParser: rename to CNumberParser
A new NumberParser library based on std::from_chars() will be added.
2024-01-04 21:02:45 +01:00
Max Kellermann b283fe07af lib/expat/ExpatParser: pass std::string_view to CharacterData() 2024-01-04 20:55:14 +01:00
Max Kellermann cbd031ca7f lib/upnp/Action: common UpnpSendAction() wrapper for pupnp and npupnp
Merge a lot of duplicate code.
2024-01-04 17:40:59 +01:00
Max Kellermann 95842e7984 db/upnp: eliminate the std::forward_list, use IterableSplitString() 2024-01-04 16:31:28 +01:00
Max Kellermann cc41e95806 db/upnp: add `rootid_sv` 2024-01-04 16:20:44 +01:00
Max Kellermann 2c77e088b4 db/upnp: eliminate temporary std::string from Visit() 2024-01-04 16:19:03 +01:00
Max Kellermann c8e2ab6781 db/upnp/Object: smaller enums 2024-01-04 14:31:41 +01:00
Max Kellermann b2ed29b8c0 lib/upnp/ContentDirectoryService: getFriendlyName() returns std::string reference
This can avoid the overhead of casting a C string back to std::string_view.
2024-01-04 14:28:12 +01:00
Max Kellermann 1789b56a85 db/upnp: pass std::string_view to songPath() 2024-01-04 14:28:12 +01:00
Max Kellermann ee4b49d12f lib/expat/ExpatParser: pass std::string_view to Parse() 2024-01-04 14:28:12 +01:00
Rosen Penev f6dbf38e99 upnp: change interface variable name
rpc.h under Windows defines interface as struct, which blows up the
build here. Rename to avoid.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2023-12-28 19:39:05 -08:00
Max Kellermann d9fb152b95 lib/upnp/ContentDirectoryService: include some headers only with libpupnp 2023-12-28 21:18:41 +01:00
Max Kellermann 9396ffb509 db/plugins/upnp/ContentDirectoryService: add missing closing curly brace 2023-12-28 20:52:53 +01:00
Max Kellermann fe4695f92a Merge branch 'added_time_proxy_plugin' of https://github.com/jcorporation/MPD 2023-11-26 08:20:18 +01:00
Max Kellermann 08a5768764 fs/io/TextFile: split into class FileLineReader and AutoGunzipFileLineReader
Detangle dependencies.
2023-11-25 22:50:32 +01:00
jcorporation 45a4fcab1e Add support for added attribute to proxy plugin 2023-11-02 21:22:48 +01:00
jcorporation 7bf43a9712 Add "added" timestamp to song database
- added is set to current time, if a new song is added to the database.
- GetAdded falls back to mtime.

Code for proxy plugin is missing, this needs a patch for libmpdclient.

closes #378
2023-10-20 17:29:31 +02:00
gd 432675d4c2 Stickers: added support for stickers on playlists and some tag types 2023-10-15 11:25:16 +02:00
Max Kellermann 1f495efb46 test/LoadDatabase: ignore tag/charset mismatches
This program shouldn't fail just because the configuration doesn't
match - it has no configuration, it's just a dumb test program.
2023-09-07 09:54:03 +02:00
Max Kellermann 2f4e2935a3 db/upnp, playlist/pls: use AddItem(std::string_view) 2023-09-06 16:08:42 +02:00
Max Kellermann c96e8ab47c db/simple/DirectorySave: optimize duplicate checks with std::set
This reduces the CPU usage for loading a large database by more than 50%.
2023-09-06 14:56:41 +02:00
Max Kellermann 2c4ef4460f db/update/SpecialDirectory: more std::string_view migration 2023-09-06 14:51:37 +02:00
Max Kellermann 449d59af2f db/simple/Directory: use operator== to compare strings 2023-09-06 14:30:08 +02:00
Max Kellermann 851136e6fd db/simple/Directory: GetName() returns std::string_view 2023-09-06 14:29:32 +02:00
Max Kellermann ad854e9867 db/simple/Save: initialize array without memset() 2023-09-06 14:17:07 +02:00
jcorporation 082f72dd20 Add support of TAG_MUSICBRAINZ_RELEASEGROUPID
Closes #1767
2023-07-12 19:43:37 +02:00
Max Kellermann 7bb251dad8 db/update/Walk: use marker to remove deleted items
This eliminates all `Storage::GetInfo()` calls from
`UpdateWalk::PurgeDeletedFromDirectory()` and instead uses a "marker"
field to mark items that have been visited; later, all unmarked items
can be deleted.

This eliminates a lot of redundant I/O which is noticable with the
`curl` storage plugin (i.e. WebDAV).
2023-05-22 20:13:01 +02:00
Max Kellermann 9027e5c5bb release v0.23.13
-----BEGIN PGP SIGNATURE-----
 
 iQJBBAABCgArFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAmRrqn4NHG1heEBibGFy
 Zy5kZQAKCRAjbopYxttFErXiD/9QIaeO5d+U7BJK1yGkQgu5vHo4Pm34ewP8LTxs
 K2MYxQQ2jZc7PXqi5Z04wmUw8ymq1BVA2D0ytMdl1Ejcbrste7UrP+1TuD8L9JBj
 WCE+4otNVYDpx1PB32BN+gxCmJqiFtAQS+eMIz/SXdEXZ9sJvIgYRRkSiSFd0WHM
 dT3OeeZ0V8cANbXpgI+RLghRGkVdpZJo4uXh3c0OHog1fjEBWPw6+7tH/mkotM0n
 /hQjI5j14wnzZuIpkDR1kuzvGYmxJKG6LkuUqcm1WexNFbxMqDSbAlXeCmzJn7eK
 NQvtROOGNjQ84thxRPLlDlYa6vbxoTqdYgZsVHzsQZWejhqw8zsPsF+Ea0A4tkLd
 UKDQFTphZMVqx74+1u7IjQyW7x+k02iXWLwH2IheEl+BJhvEB7zEflN9TR81jek4
 RrGx7jcTArdpt7okAe2ONkHvTYtIpaK5E2voza8K4TGOMzpkVlOkyvJ+rpn8CDRf
 w0faVvmCQdSrgHKfwUUY8Z47a7d+kkKpFLlvvzNoDV8drQXfgIj5t9HOLATSVVux
 l2pbgauXFsKyd4IsByXj+m8cBSvmy2C4eLJCsmguiZEvcobdJtzwOr4KuwQDjBsC
 8HW0BD0t9S1dSL59vJdMG+CfK/QU5rmAIkxdydD42uo9UmSS78xw1uQgi9oDaPa8
 XNCGdQ==
 =nOGh
 -----END PGP SIGNATURE-----

Merge tag 'v0.23.13'

release v0.23.13
2023-05-22 19:52:08 +02:00
Max Kellermann 068cd559e1 db/update/Walk: clear `Song::in_playlist`
Without clearing all `in_playlist` flags, the songs will never be
revealed again if they were hidden once by a CUE sheet, not even after
the CUE sheet gets deleted or modified.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/1784
2023-05-22 15:41:58 +02:00
Max Kellermann 1417578b3d db/update/Archive: validate directory names
Fixes assertion failure if the ZIP file contains a path that begins
with a slash.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/1793
2023-05-21 20:57:38 +02:00
Max Kellermann 96befa138c db/update/Archive: ignore filenames with newline character 2023-05-21 20:56:38 +02:00
Max Kellermann 16a99804de db/update/Archive: move check to IsAcceptableFilename() 2023-05-21 20:56:32 +02:00
Max Kellermann 75a39ed279 db/update/Archive: remove useless log message 2023-05-21 20:55:59 +02:00
datasone d4f3dd49b4 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`](a57bcd0238/src/db/plugins/simple/Directory.cxx (L237)). But
`in_playlist` is not stored and only updated in
[`UpdateWalk::PurgeDanglingFromPlaylists`](a57bcd0238/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-05-21 20:51:47 +02:00
Max Kellermann 31dc8b73b7 db/update/Archive: validate directory names
Fixes assertion failure if the ZIP file contains a path that begins
with a slash.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/1793
2023-04-30 08:46:52 +02:00
Max Kellermann e84db4f411 db/update/Archive: ignore filenames with newline character 2023-04-30 08:45:34 +02:00
Max Kellermann 395bf34a91 db/update/Archive: move check to IsAcceptableFilename() 2023-04-30 08:42:16 +02:00