Switched from sync transcoder to async transcoder

This commit is contained in:
emeric
2020-12-12 14:43:33 +01:00
parent 0586e93655
commit eea27b86f0
34 changed files with 959 additions and 504 deletions
+4 -5
View File
@@ -19,7 +19,7 @@
#include "CoverArtGrabber.hpp"
#include "av/AvInfo.hpp"
#include "av/IAudioFile.hpp"
#include "database/Release.hpp"
#include "database/Session.hpp"
@@ -125,7 +125,7 @@ Grabber::Grabber(const std::filesystem::path& execPath,
}
std::unique_ptr<IEncodedImage>
Grabber::getFromAvMediaFile(const Av::MediaFile& input, ImageSize width) const
Grabber::getFromAvMediaFile(const Av::IAudioFile& input, ImageSize width) const
{
std::unique_ptr<IEncodedImage> image;
@@ -303,10 +303,9 @@ Grabber::getFromTrack(const std::filesystem::path& p, ImageSize width) const
try
{
const Av::MediaFile input {p};
image = getFromAvMediaFile(input, width);
image = getFromAvMediaFile(*Av::parseAudioFile(p), width);
}
catch (Av::AvException& e)
catch (Av::Exception& e)
{
LMS_LOG(COVER, ERROR) << "Cannot get covers from track " << p.string() << ": " << e.what();
}
+2 -2
View File
@@ -39,7 +39,7 @@ namespace Database
namespace Av
{
class MediaFile;
class IAudioFile;
}
namespace CoverArt
@@ -106,7 +106,7 @@ namespace CoverArt
void flushCache() override;
std::shared_ptr<IEncodedImage> getFromTrack(Database::Session& dbSession, Database::IdType trackId, ImageSize width, bool allowReleaseFallback);
std::unique_ptr<IEncodedImage> getFromAvMediaFile(const Av::MediaFile& input, ImageSize width) const;
std::unique_ptr<IEncodedImage> getFromAvMediaFile(const Av::IAudioFile& input, ImageSize width) const;
std::unique_ptr<IEncodedImage> getFromCoverFile(const std::filesystem::path& p, ImageSize width) const;
std::unique_ptr<IEncodedImage> getFromTrack(const std::filesystem::path& path, ImageSize width) const;