Skip to content

Commit

Permalink
Merge branch 'develop' for release v3.62.0
Browse files Browse the repository at this point in the history
  • Loading branch information
epoupon committed Dec 18, 2024
2 parents 864125c + 079acbd commit fcc5798
Show file tree
Hide file tree
Showing 241 changed files with 4,442 additions and 2,554 deletions.
6 changes: 5 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,9 @@ CheckOptions:
- key: cppcoreguidelines-avoid-do-while.IgnoreMacros
value: '1'
- key: performance-unnecessary-value-param.AllowedTypes
value: "shared_ptr"
value: "shared_ptr;ObjectPtr;.*::pointer"
- key: cppcoreguidelines-special-member-functions.AllowMissingMoveFunctionsWhenCopyIsDeleted
value: '1'
- key: cppcoreguidelines-special-member-functions.AllowSoleDefaultDtor
value: '1'
...
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
CMakeCache.txt
CMakeFiles/
build/
.vscode/
.cache/
.vscode/
6 changes: 5 additions & 1 deletion approot/messages.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,10 @@
<!--Scanner Controller-->
<message id="Lms.Admin.ScannerController.bad-duration">Cannot get track duration</message>
<message id="Lms.Admin.ScannerController.cannot-read-audio-file">Cannot parse audio file</message>
<message id="Lms.Admin.ScannerController.cannot-read-file">Cannot read file</message>
<message id="Lms.Admin.ScannerController.cannot-read-image-file">Cannot parse image file</message>
<message id="Lms.Admin.ScannerController.cannot-read-lyrics-file">Cannot parse lyrics file</message>
<message id="Lms.Admin.ScannerController.cannot-read-file">Cannot read file</message>
<message id="Lms.Admin.ScannerController.cannot-read-playlist-file">Cannot parse playlist file</message>
<message id="Lms.Admin.ScannerController.compact">Compact the database. <strong>Caution:</strong> this may take a while and will block the whole application during the compact step!</message>
<message id="Lms.Admin.ScannerController.duplicates-header">{1} duplicate files:</message>
<message id="Lms.Admin.ScannerController.errors-header">{1} errors:</message>
Expand All @@ -119,6 +120,7 @@
<message id="Lms.Admin.ScannerController.status-in-progress">Scanning: step {1}/{2}</message>
<message id="Lms.Admin.ScannerController.step-associating-artist-images">Associating artist images: {1}%...</message>
<message id="Lms.Admin.ScannerController.step-associating-external-lyrics">Associating external lyrics: {1}%...</message>
<message id="Lms.Admin.ScannerController.step-associating-playlist-tracks">Associating playlist tracks: {1}%...</message>
<message id="Lms.Admin.ScannerController.step-associating-release-images">Associating release images: {1}%...</message>
<message id="Lms.Admin.ScannerController.step-checking-for-duplicate-files">Checking for duplicate files... {1} files</message>
<message id="Lms.Admin.ScannerController.step-checking-for-removed-files">Checking for removed files... {1}%</message>
Expand Down Expand Up @@ -267,6 +269,8 @@

<!--Explore:TrackLists-->
<message id="Lms.Explore.TrackLists.del-tracklist-confirm">Delete playlist?</message>
<message id="Lms.Explore.TrackLists.type-owned">My Playlists</message>
<message id="Lms.Explore.TrackLists.type-shared">Shared playlists</message>

<!--Explore:Search-->
<message id="Lms.Explore.Search.search-placeholder">Search...</message>
Expand Down
6 changes: 5 additions & 1 deletion approot/messages_fr.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,10 @@
<!--Scanner Controller-->
<message id="Lms.Admin.ScannerController.bad-duration">Impossible de récupérer la durée de la piste</message>
<message id="Lms.Admin.ScannerController.cannot-read-audio-file">Impossible d'analyser le fichier audio</message>
<message id="Lms.Admin.ScannerController.cannot-read-file">Impossible de lire le fichier</message>
<message id="Lms.Admin.ScannerController.cannot-read-image-file">Impossible d'analyser le fichier image</message>
<message id="Lms.Admin.ScannerController.cannot-read-lyrics-file">Impossible d'analyser le fichier de paroles</message>
<message id="Lms.Admin.ScannerController.cannot-read-file">Impossible de lire le fichier</message>
<message id="Lms.Admin.ScannerController.cannot-read-playlist-file">Impossible d'analyser le fichier de liste de lecture</message>
<message id="Lms.Admin.ScannerController.compact">Compacter la base de données. <strong>Attention :</strong> cette opération peut prendre du temps et va vérouiller l'application pendant toute l'étape de compactage!</message>
<message id="Lms.Admin.ScannerController.duplicates-header">{1} fichiers dupliqués :</message>
<message id="Lms.Admin.ScannerController.errors-header">{1} erreurs :</message>
Expand All @@ -119,6 +120,7 @@
<message id="Lms.Admin.ScannerController.status-in-progress">En cours de scan : étape {1}/{2}</message>
<message id="Lms.Admin.ScannerController.step-associating-artist-images">Association des images des artistes: {1}%...</message>
<message id="Lms.Admin.ScannerController.step-associating-external-lyrics">Association des paroles externes: {1}%...</message>
<message id="Lms.Admin.ScannerController.step-associating-playlist-tracks">Association des pistes des listes de lectures: {1}%...</message>
<message id="Lms.Admin.ScannerController.step-associating-release-images">Association des images des albums: {1}%...</message>
<message id="Lms.Admin.ScannerController.step-checking-for-duplicate-files">Vérification des fichiers dupliqués... {1} fichiers</message>
<message id="Lms.Admin.ScannerController.step-checking-for-removed-files">Vérification des fichiers supprimés... {1}%</message>
Expand Down Expand Up @@ -267,6 +269,8 @@

<!--Explore:TrackLists-->
<message id="Lms.Explore.TrackLists.del-tracklist-confirm">Supprimer la liste de lecture ?</message>
<message id="Lms.Explore.TrackLists.type-owned">Mes listes</message>
<message id="Lms.Explore.TrackLists.type-shared">Listes partagées</message>

<!--Explore:Search-->
<message id="Lms.Explore.Search.search-placeholder">Rechercher...</message>
Expand Down
6 changes: 5 additions & 1 deletion approot/messages_it.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,10 @@
<!--Scanner Controller-->
<message id="Lms.Admin.ScannerController.bad-duration">Non sono stato in grado di determinare la durata della traccia</message>
<message id="Lms.Admin.ScannerController.cannot-read-audio-file">Impossibile analizzare il file audio</message>
<message id="Lms.Admin.ScannerController.cannot-read-file">Non in grado di leggere il file</message>
<message id="Lms.Admin.ScannerController.cannot-read-image-file">Impossibile analizzare il file immagine</message>
<message id="Lms.Admin.ScannerController.cannot-read-lyrics-file">Impossibile analizzare il file dei testi</message>
<message id="Lms.Admin.ScannerController.cannot-read-file">Non in grado di leggere il file</message>
<message id="Lms.Admin.ScannerController.cannot-read-playlist-file">Impossibile analizzare il file della playlist</message>
<message id="Lms.Admin.ScannerController.compact">Compatta il database. <strong>Attenzione:</strong> ciò potrebbe richiedere del tempo e bloccherà l'intera applicazione durante il passaggio di compattazione!</message>
<message id="Lms.Admin.ScannerController.duplicates-header">{1} file duplicati:</message>
<message id="Lms.Admin.ScannerController.errors-header">{1} errori:</message>
Expand All @@ -119,6 +120,7 @@
<message id="Lms.Admin.ScannerController.status-in-progress">Scansione: passo {1}/{2}</message>
<message id="Lms.Admin.ScannerController.step-associating-artist-images">Associando immagini degli artisti: {1}%...</message>
<message id="Lms.Admin.ScannerController.step-associating-external-lyrics">Associazione dei testi esterni: {1}%...</message>
<message id="Lms.Admin.ScannerController.step-associating-playlist-tracks">Associando brani della playlist: {1}%...</message>
<message id="Lms.Admin.ScannerController.step-associating-release-images">Associando immagini degli album: {1}%...</message>
<message id="Lms.Admin.ScannerController.step-checking-for-duplicate-files">Controllo duplicati... {1} files</message>
<message id="Lms.Admin.ScannerController.step-checking-for-removed-files">Controllo file... {1}%</message>
Expand Down Expand Up @@ -267,6 +269,8 @@

<!--Explore:TrackLists-->
<message id="Lms.Explore.TrackLists.del-tracklist-confirm">Eliminare la playlist?</message>
<message id="Lms.Explore.TrackLists.type-owned">Le mie liste</message>
<message id="Lms.Explore.TrackLists.type-shared">Liste condivise</message>

<!--Explore:Search-->
<message id="Lms.Explore.Search.search-placeholder">Ricerca...</message>
Expand Down
6 changes: 5 additions & 1 deletion approot/messages_pl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,10 @@
<!--Scanner Controller-->
<message id="Lms.Admin.ScannerController.bad-duration">Nie udało się ustalić długości ścieżki</message>
<message id="Lms.Admin.ScannerController.cannot-read-audio-file">Nie można przeanalizować pliku audio</message>
<message id="Lms.Admin.ScannerController.cannot-read-file">Nie udało się odczytać pliku</message>
<message id="Lms.Admin.ScannerController.cannot-read-image-file">Nie można przeanalizować pliku obrazu</message>
<message id="Lms.Admin.ScannerController.cannot-read-lyrics-file">Nie można przetworzyć pliku z tekstem</message>
<message id="Lms.Admin.ScannerController.cannot-read-file">Nie udało się odczytać pliku</message>
<message id="Lms.Admin.ScannerController.cannot-read-playlist-file">Nie można przeanalizować pliku playlisty</message>
<message id="Lms.Admin.ScannerController.compact">Sprasuj bazę danych. <strong>Uwaga:</strong> może to trochę zająć, a cała aplikacja będzie w tym czasie zablokowana!</message>
<message id="Lms.Admin.ScannerController.duplicates-header">
<plural case="0">{1} zduplikowany plik:</plural>
Expand Down Expand Up @@ -128,6 +129,7 @@
<message id="Lms.Admin.ScannerController.status-in-progress">Skanowanie: krok {1}/{2}</message>
<message id="Lms.Admin.ScannerController.step-associating-artist-images">Kojarzenie obrazów artystów: {1}%...</message>
<message id="Lms.Admin.ScannerController.step-associating-external-lyrics">Kojarzenie zewnętrznych tekstów: {1}%...</message>
<message id="Lms.Admin.ScannerController.step-associating-playlist-tracks">Kojarzenie utworów z playlisty: {1}%...</message>
<message id="Lms.Admin.ScannerController.step-associating-release-images">Kojarzenie obrazów albumów: {1}%...</message>
<message id="Lms.Admin.ScannerController.step-checking-for-duplicate-files">
<plural case="0">Sprawdzanie duplikatów... {1} plik</plural>
Expand Down Expand Up @@ -293,6 +295,8 @@

<!--Explore:TrackLists-->
<message id="Lms.Explore.TrackLists.del-tracklist-confirm">Usunąć listę odtwarzania?</message>
<message id="Lms.Explore.TrackLists.type-owned">Moje listy</message>
<message id="Lms.Explore.TrackLists.type-shared">Udostępnione listy</message>

<!--Explore:Search-->
<message id="Lms.Explore.Search.search-placeholder">Szukaj...</message>
Expand Down
4 changes: 4 additions & 0 deletions approot/messages_zh.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
<message id="Lms.Admin.ScannerController.cannot-read-file">无法读取文件</message>



<message id="Lms.Admin.ScannerController.duplicates-header">{1} 个重复文件:</message>
<message id="Lms.Admin.ScannerController.errors-header">{1} 个错误:</message>

Expand All @@ -121,6 +122,7 @@




<message id="Lms.Admin.ScannerController.step-checking-for-removed-files">检查文件中... {1}%</message>


Expand Down Expand Up @@ -268,6 +270,8 @@
<!--Explore:TrackLists-->
<message id="Lms.Explore.TrackLists.del-tracklist-confirm">删除播放列表?</message>



<!--Explore:Search-->
<message id="Lms.Explore.Search.search-placeholder">搜索...</message>

Expand Down
2 changes: 2 additions & 0 deletions approot/tracklist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
<li>${play-shuffled class="dropdown-item"}</li>
<li>${play-last class="dropdown-item"}</li>
<li>${download class="dropdown-item"}</li>
${<if-has-delete>}
<li>${delete class="dropdown-item"}</li>
${</if-has-delete>}
</ul>
</div>
</div>
Expand Down
20 changes: 18 additions & 2 deletions approot/tracklists.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,28 @@
<messages xmlns:if="Wt.WTemplate.conditions">

<message id="Lms.Explore.TrackLists.template">
<div class="d-flex flex-row-reverse">
${sort-mode}
<div class="d-flex justify-content-between align-items-center mb-3">
${tracklist-type class="me-1"}
<div class="d-flex">
${search class="form-control form-control-sm me-1" type="search"}
${sort-mode}
</div>
</div>
${tracklists}
</message>

<message id="Lms.Explore.TrackLists.template.type-selector">
<div class="dropdown">
<button class="btn btn-sm btn-outline-primary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
${selected-item}
</button>
<ul class="dropdown-menu">
<li>${owned class="dropdown-item"}</li>
<li>${shared class="dropdown-item"}</li>
</ul>
</div>
</message>

<message id="Lms.Explore.TrackLists.template.sort-mode">
<div class="dropdown">
<button class="btn btn-sm btn-outline-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
Expand Down
3 changes: 0 additions & 3 deletions conf/lms.conf
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ api-subsonic-support-user-password-auth = true;
# Main usage is to make auto detections for the 'p' (password) parameter work
api-subsonic-old-server-protocol-clients = ("DSub");

# List of clients for whom a default cover is served (as they do not have their own)
api-subsonic-default-cover-clients = ("DSub", "substreamer");

# List of clients for whom open subsonic extensions and extra fields are disabled
api-open-subsonic-disabled-clients = ("DSub");

Expand Down
24 changes: 13 additions & 11 deletions src/libs/av/impl/AudioFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ extern "C"
#include "core/ILogger.hpp"
#include "core/String.hpp"

#include "av/Types.hpp"

namespace lms::av
{
namespace
Expand All @@ -43,9 +45,9 @@ namespace lms::av
std::array<char, 128> buf = { 0 };

if (::av_strerror(error, buf.data(), buf.size()) == 0)
return &buf[0];
else
return "Unknown error";
return buf.data();

return "Unknown error";
}

class AudioFileException : public Exception
Expand Down Expand Up @@ -158,7 +160,7 @@ namespace lms::av
{
ContainerInfo info;
info.bitrate = _context->bit_rate;
info.duration = std::chrono::milliseconds{ _context->duration == AV_NOPTS_VALUE ? 0 : _context->duration / AV_TIME_BASE * 1000 };
info.duration = std::chrono::milliseconds{ _context->duration == AV_NOPTS_VALUE ? 0 : _context->duration / AV_TIME_BASE * 1'000 };
info.name = _context->iformat->name;

return info;
Expand Down Expand Up @@ -237,14 +239,13 @@ namespace lms::av
return false;
}

void AudioFile::visitAttachedPictures(std::function<void(const Picture&)> func) const
void AudioFile::visitAttachedPictures(std::function<void(const Picture&, const MetadataMap&)> func) const
{
static const std::unordered_map<int, std::string> codecMimeMap{
{ AV_CODEC_ID_BMP, "image/x-bmp" },
{ AV_CODEC_ID_BMP, "image/bmp" },
{ AV_CODEC_ID_GIF, "image/gif" },
{ AV_CODEC_ID_MJPEG, "image/jpeg" },
{ AV_CODEC_ID_PNG, "image/png" },
{ AV_CODEC_ID_PNG, "image/x-png" },
{ AV_CODEC_ID_PPM, "image/x-portable-pixmap" },
};

Expand All @@ -262,6 +263,9 @@ namespace lms::av
continue;
}

MetadataMap metadata;
getMetaDataFromDictionnary(avstream->metadata, metadata);

Picture picture;

auto itMime = codecMimeMap.find(avstream->codecpar->codec_id);
Expand All @@ -277,10 +281,8 @@ namespace lms::av

const AVPacket& pkt{ avstream->attached_pic };

picture.data = reinterpret_cast<const std::byte*>(pkt.data);
picture.dataSize = pkt.size;

func(picture);
picture.data = std::span{ reinterpret_cast<const std::byte*>(pkt.data), static_cast<std::size_t>(pkt.size) };
func(picture, metadata);
}
}

Expand Down
11 changes: 4 additions & 7 deletions src/libs/av/impl/AudioFile.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ struct AVFormatContext;

namespace lms::av
{

class AudioFile final : public IAudioFile
{
public:
AudioFile(const std::filesystem::path& p);
~AudioFile();
~AudioFile() override;
AudioFile(const AudioFile&) = delete;
AudioFile& operator=(const AudioFile&) = delete;

const std::filesystem::path& getPath() const override;
ContainerInfo getContainerInfo() const override;
Expand All @@ -39,16 +40,12 @@ namespace lms::av
std::optional<StreamInfo> getBestStreamInfo() const override;
std::optional<std::size_t> getBestStreamIndex() const override;
bool hasAttachedPictures() const override;
void visitAttachedPictures(std::function<void(const Picture&)> func) const override;
void visitAttachedPictures(std::function<void(const Picture&, const MetadataMap&)> func) const override;

private:
AudioFile(const AudioFile&) = delete;
AudioFile& operator=(const AudioFile&) = delete;

std::optional<StreamInfo> getStreamInfo(std::size_t streamIndex) const;

const std::filesystem::path _p;
AVFormatContext* _context{};
};

} // namespace lms::av
7 changes: 4 additions & 3 deletions src/libs/av/impl/Transcoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@
#include "core/IChildProcessManager.hpp"
#include "core/IConfig.hpp"
#include "core/ILogger.hpp"
#include "core/Path.hpp"
#include "core/Service.hpp"

#include "av/Types.hpp"

namespace lms::av::transcoding
{

Expand Down Expand Up @@ -81,7 +82,7 @@ namespace lms::av::transcoding
{
if (!std::filesystem::exists(_inputParameters.trackPath))
throw Exception{ "File '" + _inputParameters.trackPath.string() + "' does not exist!" };
else if (!std::filesystem::is_regular_file(_inputParameters.trackPath))
if (!std::filesystem::is_regular_file(_inputParameters.trackPath))
throw Exception{ "File '" + _inputParameters.trackPath.string() + "' is not regular!" };
}
catch (const std::filesystem::filesystem_error& e)
Expand All @@ -108,7 +109,7 @@ namespace lms::av::transcoding
args.emplace_back("-ss");

std::ostringstream oss;
oss << std::fixed << std::showpoint << std::setprecision(3) << (_outputParameters.offset.count() / float{ 1000 });
oss << std::fixed << std::showpoint << std::setprecision(3) << (_outputParameters.offset.count() / float{ 1'000 });
args.emplace_back(oss.str());
}

Expand Down
3 changes: 0 additions & 3 deletions src/libs/av/impl/Transcoder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@

#pragma once

#include <filesystem>
#include <functional>

#include "av/TranscodingParameters.hpp"
#include "av/Types.hpp"

namespace lms::core
{
Expand All @@ -37,7 +35,6 @@ namespace lms::av::transcoding
public:
Transcoder(const InputParameters& inputParameters, const OutputParameters& outputParameters);
~Transcoder();

Transcoder(const Transcoder&) = delete;
Transcoder& operator=(const Transcoder&) = delete;
Transcoder(Transcoder&&) = delete;
Expand Down
Loading

0 comments on commit fcc5798

Please sign in to comment.