Covers. Minor bugfixes

This commit is contained in:
emeric
2014-06-25 12:43:11 +02:00
parent 17662d4eb8
commit 47a12b220f
6 changed files with 28 additions and 10 deletions
+3 -3
View File
@@ -14,9 +14,9 @@
- Create a new type: "share", that handles every other types in a directory based share?
- Group video in "video groups". Each video may has sub groups (current "Path" class)
- Simplify database and remove the Path class
- Use limits for strings?
- Convert to UTF-8 in name strings
- Use size limits for strings?
- Manage a global database revision number
- Process only files whose extensions are well known in audio/video world (avoid useless parsing/errors)
[Audio]
- ReleaseView/ArtistView/GenreView: <All> -> Track count for this special category. Easier: add a special entry '<All>' that contains everything?
@@ -35,7 +35,7 @@
- Use Groups/SubGroups to organize videos (WTreeView?)
[Remote API]
- Think about a remote API to get/retrieve media (i.e. for mobile apps)
- Use SSL based sockets
[Layout]
- Make it mobile browser compatible
+4 -4
View File
@@ -52,10 +52,10 @@ AC_CHECK_LIB( [boost_locale],
,
[AC_MSG_ERROR([libboost_locale not found!])])
#AC_CHECK_LIB( [boost_thread],
# [main],
# ,
# [AC_MSG_ERROR([libboost_thread not found!])])
AC_CHECK_LIB( [boost_thread],
[main],
,
[AC_MSG_ERROR([libboost_thread not found!])])
#AC_CHECK_LIB( [boost_date_time],
# [main],
+4
View File
@@ -13,6 +13,10 @@ bool
CoverArt::scale(std::size_t size)
{
bool res = false;
if (!size)
return false;
try {
boost::gil::rgb8_image_t source;
+6
View File
@@ -39,6 +39,9 @@ Grabber::getFromTrack(Track::pointer track)
{
std::vector<CoverArt> res;
if (!track)
return std::vector<CoverArt>();
try
{
Av::InputFormatContext input(track->getPath());
@@ -56,6 +59,9 @@ Grabber::getFromTrack(Track::pointer track)
std::vector<CoverArt>
Grabber::getFromRelease(Release::pointer release)
{
if (!release)
return std::vector<CoverArt>();
// TODO
// Check if there is an image file in the directory of the release
// For now, just get the cover art from the first track of the release
+2 -1
View File
@@ -1,3 +1,4 @@
#include <boost/thread.hpp>
#include "DatabaseRefreshService.hpp"
@@ -12,7 +13,7 @@ DatabaseRefreshService::DatabaseRefreshService(boost::asio::io_service& ioServic
_database.watchDirectory( WatchedDirectory("/storage/common/Media/Video", WatchedDirectory::Video) );
// TODO launch thread
// boost::thread refreshThread(boost::bind(&Database::refresh, &database));
boost::thread refreshThread(boost::bind(&Database::refresh, &_database));
}
void
@@ -2,7 +2,6 @@
#include <boost/locale.hpp>
#include <boost/foreach.hpp>
#include "AudioCollectionRequestHandler.hpp"
@@ -275,7 +274,15 @@ AudioCollectionRequestHandler::processGetCoverArt(const AudioCollectionRequest::
AudioCollectionResponse_CoverArt* cover_art = response.add_cover_art();
if (request.has_size())
coverArt.scale(request.size());
{
std::size_t size = request.size();
if (size > _maxCoverArtSize || size == 0)
size = _maxCoverArtSize;
if (size < _minCoverArtSize)
size = _minCoverArtSize;
coverArt.scale(size);
}
cover_art->set_mime_type(coverArt.getMimeType());
cover_art->set_data( std::string( coverArt.getData().begin(), coverArt.getData().end()) );