mirror of
https://github.com/clementine-player/Clementine
synced 2025-01-19 04:50:16 +01:00
Added signal to catch transcoded name, altered duplicate format to avoid tagging problems
This commit is contained in:
parent
74256ee5ff
commit
215056e1b9
@ -297,7 +297,7 @@ void Transcoder::AddJob(const QString& input,
|
|||||||
// Never overwrite existing files
|
// Never overwrite existing files
|
||||||
if (QFile::exists(job.output)) {
|
if (QFile::exists(job.output)) {
|
||||||
for (int i=0 ; ; ++i) {
|
for (int i=0 ; ; ++i) {
|
||||||
QString new_filename = QString("%1.%2").arg(job.output).arg(i);
|
QString new_filename = QString("%1.%2.%3").arg(job.output.section('.',0,-2)).arg(i).arg(preset.extension_);
|
||||||
if (!QFile::exists(new_filename)) {
|
if (!QFile::exists(new_filename)) {
|
||||||
job.output = new_filename;
|
job.output = new_filename;
|
||||||
break;
|
break;
|
||||||
@ -331,8 +331,10 @@ Transcoder::StartJobStatus Transcoder::MaybeStartNextJob() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Job job = queued_jobs_.takeFirst();
|
Job job = queued_jobs_.takeFirst();
|
||||||
if (StartJob(job))
|
if (StartJob(job)) {
|
||||||
|
emit(JobOutputName(job.output));
|
||||||
return StartedSuccessfully;
|
return StartedSuccessfully;
|
||||||
|
}
|
||||||
|
|
||||||
emit JobComplete(job.input, false);
|
emit JobComplete(job.input, false);
|
||||||
return FailedToStart;
|
return FailedToStart;
|
||||||
|
@ -75,6 +75,7 @@ class Transcoder : public QObject {
|
|||||||
void JobComplete(const QString& filename, bool success);
|
void JobComplete(const QString& filename, bool success);
|
||||||
void LogLine(const QString& message);
|
void LogLine(const QString& message);
|
||||||
void AllJobsComplete();
|
void AllJobsComplete();
|
||||||
|
void JobOutputName(const QString& filename);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool event(QEvent* e);
|
bool event(QEvent* e);
|
||||||
|
Loading…
Reference in New Issue
Block a user