Make db refresh less verbose
This commit is contained in:
@@ -69,21 +69,14 @@ Updater::processAudioFile( const boost::filesystem::path& file, Stats& stats)
|
|||||||
// Skip file if last write is the same
|
// Skip file if last write is the same
|
||||||
Wt::Dbo::ptr<Track> track = Track::getByPath(_db.getSession(), file);
|
Wt::Dbo::ptr<Track> track = Track::getByPath(_db.getSession(), file);
|
||||||
if (track && track->getLastWriteTime() == lastWriteTime)
|
if (track && track->getLastWriteTime() == lastWriteTime)
|
||||||
{
|
|
||||||
std::cerr << "Skipped '" << file << "' (last write time match)" << std::endl;
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
std::vector<unsigned char> checksum;
|
std::vector<unsigned char> checksum;
|
||||||
computeCrc( file, checksum );
|
computeCrc( file, checksum );
|
||||||
|
|
||||||
// Skip file if its checksum is still the same
|
// Skip file if its checksum is still the same
|
||||||
if (track && track->getChecksum() == checksum) {
|
if (track && track->getChecksum() == checksum)
|
||||||
std::cerr << "Skipped '" << file << "' (checksum match)" << std::endl;
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
std::cout << "parsing file " << file << std::endl;
|
|
||||||
|
|
||||||
MetaData::Items items;
|
MetaData::Items items;
|
||||||
_metadataParser.parse(file, items);
|
_metadataParser.parse(file, items);
|
||||||
@@ -239,7 +232,6 @@ Updater::processAudioFile( const boost::filesystem::path& file, Stats& stats)
|
|||||||
void
|
void
|
||||||
Updater::refreshAudioDirectory( const boost::filesystem::path& p, Stats& stats)
|
Updater::refreshAudioDirectory( const boost::filesystem::path& p, Stats& stats)
|
||||||
{
|
{
|
||||||
std::cout << "Refreshing audio directory " << p << std::endl;
|
|
||||||
if (boost::filesystem::exists(p) && boost::filesystem::is_directory(p)) {
|
if (boost::filesystem::exists(p) && boost::filesystem::is_directory(p)) {
|
||||||
|
|
||||||
typedef std::vector<boost::filesystem::path> Paths; // store paths,
|
typedef std::vector<boost::filesystem::path> Paths; // store paths,
|
||||||
@@ -267,7 +259,6 @@ Updater::refreshAudioDirectory( const boost::filesystem::path& p, Stats& stats)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
std::cout << "Refreshing audio directory " << p << ": DONE" << std::endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -20,8 +20,6 @@ AvFormat::parse(const boost::filesystem::path& p, Items& items)
|
|||||||
Av::InputFormatContext input(p);
|
Av::InputFormatContext input(p);
|
||||||
input.findStreamInfo(); // needed by input.getDurationSecs
|
input.findStreamInfo(); // needed by input.getDurationSecs
|
||||||
|
|
||||||
std::cout << "Processing file '" << p << "'" << std::endl;
|
|
||||||
|
|
||||||
std::map<std::string, std::string> metadata;
|
std::map<std::string, std::string> metadata;
|
||||||
input.getMetadata().get(metadata);
|
input.getMetadata().get(metadata);
|
||||||
|
|
||||||
|
|||||||
@@ -46,11 +46,7 @@ InputMediaFile::InputMediaFile(const boost::filesystem::path& p)
|
|||||||
{
|
{
|
||||||
// Reject Video stream hat are in fact cover arts
|
// Reject Video stream hat are in fact cover arts
|
||||||
if (avStream.hasAttachedPic())
|
if (avStream.hasAttachedPic())
|
||||||
{
|
|
||||||
std::cout << "Rejecting stream since it is an attached picture!" << std::endl;
|
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
avMediaTypes.push_back(avStream.getCodecContext().getType());
|
avMediaTypes.push_back(avStream.getCodecContext().getType());
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user