Commit Graph

128 Commits

Author SHA1 Message Date
Max Kellermann 08a5768764 fs/io/TextFile: split into class FileLineReader and AutoGunzipFileLineReader
Detangle dependencies.
2023-11-25 22:50:32 +01:00
Max Kellermann 7d31659137 PlaylistFile: add missing include 2023-10-07 12:28:31 +02:00
Max Kellermann 148aca23be use SPDX IDs, replacing the long copyright headers 2023-03-06 14:59:48 +01:00
Max Kellermann 04e60d67ae command/playlist: allow range in "playlistmove"
Closes https://github.com/MusicPlayerDaemon/MPD/issues/1689
2023-03-06 12:01:45 +01:00
Max Kellermann 8fe29f5728 release v0.23.11
-----BEGIN PGP SIGNATURE-----
 
 iQJBBAABCgArFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAmOE2gINHG1heEBibGFy
 Zy5kZQAKCRAjbopYxttFEiugD/9OKEBR9tfrJvtVGuO2INtaMeAzlZ9swFYCkphF
 i2R7H9/9E0AvtgyFi/6EDNgFCBbnUzSIGbtdc78EwHE6GxeK/Q9G1fo9AC+6I8Ww
 2ScEV9NKIMGTbsRvoomKnGZWpvNTpadPlLa02bckXpKK3wQUPhLb8RAH3newZ0RC
 OXs+mzSRReRKpjUBxZsI+6f+aajM6/PoiOmBbrNbYbsSlkpKtLeW8ptkQxPME12B
 QD9e7yf9ZndYfoHJdmmPxfvIGIEDATCs8MzY8tFUYkhdbEk0C0aRZQTODQS3DATp
 0wrmlJzmceiN2nhKjthg1bvC+jobPywIuDZdrEuyFumN/EZxldKAUCezduV+Dohm
 UPkQp5yiSTZRZVYQMEOSW6cMndC7URFrtn643+jV7SGkTmmV6nVOyg4e9GR1BakT
 rY0nZGr7dwEInODkA5lXMhph3u8aZa2Mfo5B8m2aloGVHYOX1t3bH07ym5oJiviq
 eiQx/bMpaS6ECCSnmHPGDl0NHHWDiPGv96EyPO2N9oeWiNuZz/Fla0N99Mi/JbVI
 EpSHF89F+bfiw5qIeet93ZrXjwQjMuC6zofZ1jbVFek2eKszCZSNdx233VLz170G
 edyN5Vxy3r24YBy/nrZVXPRxsj65KOxF1TZ9SzHKmfnuU45a+JZjZuWz5yedPn2/
 3fy7oA==
 =eLEd
 -----END PGP SIGNATURE-----

Merge tag 'v0.23.11'

release v0.23.11
2022-11-28 17:00:38 +01:00
Max Kellermann eaecbcafb2 PlaylistFile: disallow backslash in playlist names on Windows
The function spl_valid_name() should verify playlist names and prevent
path traversal, but it failed to do so on Windows, because it forgot
to check for backslashes.

This buggy piece of code was already present when stored playlists
were initially implemented in 2006 by commit 08003904d7, and
even during the many rounds of code refactoring, nobody ever bothered
to verify it.  D'oh!

(Thanks, Paul Arzelier)
2022-11-28 09:53:49 +01:00
Max Kellermann cc0def15c4 Copyright year 2022 2022-07-14 17:59:35 +02:00
Max Kellermann 95a155b10d Partition: pass configuration as struct 2021-12-03 23:03:41 +01:00
Max Kellermann a5fa43b526 fs/io: move to io/ 2021-12-03 14:35:41 +01:00
Max Kellermann 48e8a26813 command/playlist: allow range in playlistdelete 2021-10-25 12:23:37 +02:00
Max Kellermann ade847bc89 PlaylistFile: fold spl_move_index() into handle_playlistmove() 2021-10-25 12:13:45 +02:00
Max Kellermann a6173e0eae command/playlist: add position parameter to "playlistadd"
Closes https://github.com/MusicPlayerDaemon/MPD/issues/1106
2021-10-25 12:10:47 +02:00
Max Kellermann 258ecb764f PlaylistFile: add class PlaylistFileEditor 2021-10-23 13:54:50 +02:00
Max Kellermann 5348f8c9c8 copyright year 2021 2021-01-01 19:54:28 +01:00
Rosen Penev e4dad42ca1 use std chr functions
The ones in std have overloads for const char/char.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-05-30 13:36:53 +02:00
Rosen Penev ab9f5d2067
replace assert.h with cassert
The former was deprecated with C++14.

According to the C++11 and C++17 standards, both files are identical.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-12 15:25:38 -07:00
Max Kellermann 2817bf9e95 copyright year 2020 2020-01-18 19:23:49 +01:00
Max Kellermann 40a2880857 util/UriUtil: split 2019-08-09 20:21:12 +02:00
Max Kellermann d663f81420 include cleanups (powered by iwyu) 2019-07-05 09:59:58 +02:00
Max Kellermann a139279575 Copyright year 2019 2019-06-17 11:17:30 +02:00
Max Kellermann 62a129c18f PlaylistFile: ignore empty playlist names
Closes https://github.com/MusicPlayerDaemon/MPD/issues/465 and
https://github.com/MusicPlayerDaemon/MPD/pull/466
2019-03-17 23:46:36 +01:00
Max Kellermann f5c9071494 *: copyright year 2018 2018-10-31 17:54:59 +01:00
Max Kellermann 90201e9970 DetachedSong, db/LightSong, SongFilter: move to src/song/ 2018-08-02 13:51:18 +02:00
Max Kellermann 32290d5eb8 fs/Path: add method ToUTF8Throw() 2018-07-18 16:51:29 +02:00
Max Kellermann dd57b81989 PlaylistFile: use struct ConfigData 2018-07-17 22:31:33 +02:00
Max Kellermann 99d5b61698 fs/Path: add operator/(Path,Path)
Modeled after std::filesystem::operator/() from C++17.
2018-07-17 18:33:32 +02:00
Max Kellermann 816603fd9a config/Config*: rename files, drop "Config" prefix 2018-07-16 19:50:07 +02:00
Max Kellermann b4b468eb27 release v0.20.11
-----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCAAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAlnnDXYQHG1heEBtdXNp
 Y3BkLm9yZwAKCRAjbopYxttFEtPBD/4sOwd7sQr/eeJr5gqVpil+CaVkHN1GpVmF
 H72uYnp5eKREywLMAqrY86hxvykeflroHyNyBF7CV5hIZV8kPl1ApN6WvjG3oFeX
 ZnM6PQjeqgqczSVUZOd92nATJw6g/Vk0qbC+h6VwhpSoq5716dAKriSO25JzDg0L
 KOwEztVsLeziKrk/sHSKjgRrYpuNS8bFVxAY8Pk9MnUhEeHB3Rb7Spd2zMUfMDLF
 1pncFliIX5bOUKzDavIo4flAWc3jj514VhS7rVaU2OYpAdsQV18Z5Ze5B+46FUan
 2gsn3oCOVbC3QV7X0do5MtD9p1tyX0HREokY3ttgut+iRz9zym2m0uC6t1DXwyVI
 cugOF70JbBYxd/ChO4rFYPHZo6A1XE7hb89AcVf6EgZyXROK077EzptprW9et0Ge
 kIUbHs01lHfA7gFefEC+8iVGSXQmEmQQp5tBnZkdUaJdpxVULdMkhhHCNU8RIIVP
 ot8guH2/9oKkCj+ytHj37SUpk7bKjbzID9XIW5a+4rQPb1oRmQMvIeKgWZ6sjHP1
 5cS7l51q0onPmulfdQti0jTuaRcwQZcyKOxBU+eKYNHGNgLsdk1QDxyDhqbCCqWv
 0seA7h+lNBGqZL7/F6s0IxsTWIwaInkZWPE1EGSRe0wvZohDtBbNhXWQDPBlgl8O
 R42Jdx6PIg==
 =8U+o
 -----END PGP SIGNATURE-----

Merge tag 'v0.20.11'

release v0.20.11
2017-10-18 10:21:39 +02:00
Max Kellermann 9703a401c5 Playlist{File,Save}: always use UTF-8 in playlists on Windows
Turns out that using CP_ACP is a lousy idea, because only very few
Unicode characters can be represented by it.  Instead, switch to UTF-8
(which every sane person on other operating system already uses).

Closes #102
2017-10-18 10:05:26 +02:00
Max Kellermann 6f37f5752b db/PlaylistInfo: use std::chrono::system_clock::time_point 2017-08-11 12:50:33 +02:00
Max Kellermann 329c3ab21b fs/FileInfo: use std::chrono::system_clock 2017-02-10 23:48:21 +01:00
Max Kellermann f689e28958 SongLoader: return instance, not pointer 2017-02-08 10:02:08 +01:00
Max Kellermann dcbab8e37a PlaylistFile: "playlistadd" creates new playlist if it does not exist, as documented 2017-01-16 20:55:19 +01:00
Max Kellermann 5900253b85 update copyright year 2017-01-03 20:48:59 +01:00
Max Kellermann 65974ceabc PlaylistFile: remove redundant existence check 2016-12-04 20:04:16 +01:00
Max Kellermann 6caf53d1c2 fs/FileSystem: RenameFile() throws exception on error 2016-12-04 19:59:33 +01:00
Max Kellermann 6961bd61ca LocateUri: migrate from class Error to C++ exceptions 2016-10-27 22:04:41 +02:00
Max Kellermann d775f13a03 fs/io/FileOutputStream: merge all classes into one, add enum Mode
Prepare to add more modes.
2016-09-04 12:57:41 +02:00
Max Kellermann ea0e6d9824 fs/FileSystem: RemoveFile() throws exception on error 2016-08-15 22:25:15 +02:00
Max Kellermann b6b8fb7d73 PlaylistFile: use TruncateFile()
As a side effect, "playlistclear" no longer creates a new playlist if
the given one doesn't yet exist.
2016-08-15 22:19:55 +02:00
Max Kellermann a0eb6d0976 PlaylistFile: use the new AllocatedPath::FromFS() range overload 2016-04-21 14:22:59 +02:00
Max Kellermann 1aee89f5ea *: include cleanup (using iwyu) 2016-03-01 22:08:13 +01:00
Max Kellermann 1d67aa7bf2 update copyright year to 2016 2016-02-26 17:54:05 +01:00
Max Kellermann f3503e0026 fs/DirectoryReader: use C++ exceptions instead of class Error 2015-12-29 12:56:26 +01:00
Max Kellermann 37862f0f20 PlaylistFile: convert more APIs from Error to std::exception 2015-12-28 14:20:37 +01:00
Max Kellermann 1f184f4aec PlaylistFile: throw exception on spl_map_to_fs() failure 2015-12-28 14:20:37 +01:00
Max Kellermann db5a691693 PlaylistFile: remove obsolete function TranslatePlaylistError() 2015-12-28 14:20:37 +01:00
Max Kellermann fe0b6a1117 PlaylistFile: convert system_error::ENOENT to PlaylistResult::NO_SUCH_LIST 2015-12-28 06:44:01 +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