Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions setup/win64/UltraStar-Manager.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ Section "Application" SecCopyUI
File "plugins\config\rename\030-renameSongTxt.xml"
File "plugins\config\rename\035-renameSongTxtSpecial.xml"
File "plugins\config\rename\040-renameSongAudio.xml"
File "plugins\config\rename\041-renameSongInstrumental.xml"
File "plugins\config\rename\042-renameSongVocals.xml"
File "plugins\config\rename\050-renameSongCover.xml"
File "plugins\config\rename\060-renameSongBackground.xml"
File "plugins\config\rename\070-renameSongVideo.xml"
Expand Down Expand Up @@ -320,6 +322,8 @@ Section "Uninstall"
Delete "$INSTDIR\plugins\config\rename\035-renameSongTxtSpecial.xml"
Delete "$INSTDIR\plugins\config\rename\040-renameSongAudio.xml"
Delete "$INSTDIR\plugins\config\rename\040-renameSongMp3.xml"
Delete "$INSTDIR\plugins\config\rename\041-renameSongInstrumental.xml"
Delete "$INSTDIR\plugins\config\rename\042-renameSongVocals.xml"
Delete "$INSTDIR\plugins\config\rename\050-renameSongCover.xml"
Delete "$INSTDIR\plugins\config\rename\060-renameSongBackground.xml"
Delete "$INSTDIR\plugins\config\rename\070-renameSongVideo.xml"
Expand Down
17 changes: 16 additions & 1 deletion src/QUMainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,22 @@ void QUMainWindow::editSongSetFileLink(QTreeWidgetItem *item, int column) {
logSrv->add(QString(tr("Audio file changed from \"%1\" to: \"%2\".")).arg(song->audio(), songItem->text(FOLDER_COLUMN)), QU::Information);
song->setAudioInfo(songItem->text(FOLDER_COLUMN));
song->save();
} else if( songItem->icon(COVER_COLUMN).isNull()
}
else if( songItem->icon(INSTRUMENTAL_COLUMN).isNull()
&& QUSongSupport::allowedAudioFiles().contains(fileScheme, Qt::CaseInsensitive)
&& column == INSTRUMENTAL_COLUMN ) {
logSrv->add(QString(tr("Instrumental file changed from \"%1\" to: \"%2\".")).arg(song->instrumental(), songItem->text(FOLDER_COLUMN)), QU::Information);
song->setInfo(INSTRUMENTAL_TAG, songItem->text(FOLDER_COLUMN));
song->save();
}
else if( songItem->icon(VOCALS_COLUMN).isNull()
&& QUSongSupport::allowedAudioFiles().contains(fileScheme, Qt::CaseInsensitive)
&& column == VOCALS_COLUMN ) {
logSrv->add(QString(tr("Vocals file changed from \"%1\" to: \"%2\".")).arg(song->vocals(), songItem->text(FOLDER_COLUMN)), QU::Information);
song->setInfo(VOCALS_TAG, songItem->text(FOLDER_COLUMN));
song->save();
}
else if( songItem->icon(COVER_COLUMN).isNull()
&& QUSongSupport::allowedImageFiles().contains(fileScheme, Qt::CaseInsensitive)
&& column == COVER_COLUMN ) {
logSrv->add(QString(tr("Cover changed from \"%1\" to: \"%2\".")).arg(song->cover(), songItem->text(FOLDER_COLUMN)), QU::Information);
Expand Down
2 changes: 1 addition & 1 deletion src/UltraStar-Manager.pro
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CONFIG += c++11 app_bundle
CONFIG += c++17 app_bundle
TEMPLATE = app
UI_DIR = ui

Expand Down
4 changes: 3 additions & 1 deletion src/plugins/rename/QURenameTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ void QURenameTask::startOn(QUSongInterface *song) {
else if (QString::compare(this->_target, "path", Qt::CaseInsensitive) == 0) song->moveAllFiles(schema);
else if (QString::compare(this->_target, "txt", Qt::CaseInsensitive) == 0) song->renameSongTxt(schema);
else if (QString::compare(this->_target, "audio", Qt::CaseInsensitive) == 0) song->renameSongAudio(schema);
else if (QString::compare(this->_target, "instrumental", Qt::CaseInsensitive) == 0) song->renameSongInstrumental(schema);
else if (QString::compare(this->_target, "vocals", Qt::CaseInsensitive) == 0) song->renameSongVocals(schema);
else if (QString::compare(this->_target, "cover", Qt::CaseInsensitive) == 0) song->renameSongCover(schema);
else if (QString::compare(this->_target, "background", Qt::CaseInsensitive) == 0) song->renameSongBackground(schema);
else if (QString::compare(this->_target, "video", Qt::CaseInsensitive) == 0) song->renameSongVideo(schema);
Expand All @@ -122,7 +124,7 @@ int QURenameTask::configure(QWidget *parent) {
* \returns a list of all possible targets used by rename tasks.
*/
QStringList QURenameTask::availableTargets() {
return QString("dir path txt audio cover background video").split(" ");
return QString("dir path txt audio instrumental vocals cover background video").split(" ");
}

QStringList QURenameTask::availableSources() {
Expand Down
12 changes: 12 additions & 0 deletions src/plugins/rename/config/041-renameSongInstrumental.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<task>
<general type="rename" >
<icon resource=":/types/instrumental.png" />
<description><![CDATA[Rename instrumental file to "Artist - Title [INSTR].*"]]></description>
<tooltip/>
</general>
<rename target="instrumental" schema="%1 - %2 [INSTR].%3" >
<data source="artist" />
<data source="title" />
<data keepSuffix="true" />
</rename>
</task>
12 changes: 12 additions & 0 deletions src/plugins/rename/config/042-renameSongVocals.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<task>
<general type="rename" >
<icon resource=":/types/vocals.png" />
<description><![CDATA[Rename vocals file to "Artist - Title [VOC].*"]]></description>
<tooltip/>
</general>
<rename target="vocals" schema="%1 - %2 [VOC].%3" >
<data source="artist" />
<data source="title" />
<data keepSuffix="true" />
</rename>
</task>
14 changes: 8 additions & 6 deletions src/plugins/rename/getTaskText.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
# python

from __future__ import absolute_import
from __future__ import print_function
import glob
import re

finder = re.compile("<!\[CDATA\[(.*?)\]\]>")
outfile = file(r"language.h", "w")
finder = re.compile(r"<!\[CDATA\[(.*?)\]\]>")
outfile = open(r"language.h", "w")

i = 1
for filename in glob.glob(r"config\*.xml"):
xml = file(filename).read()

for filename in glob.glob(r"config/*.xml"):
xml = open(filename).read()
for text in finder.findall(xml):
print >> outfile, "#define TASKTEXT%i QObject::tr(\"%s\")" % (i, text.replace('"', r'\"'))
print("#define TASKTEXT%i QObject::tr(\"%s\")" % (i, text.replace('"', r'\"')), file=outfile)
i+=1
15 changes: 15 additions & 0 deletions src/plugins/rename/getTaskText.py.bak
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# python

import glob
import re

finder = re.compile("<!\[CDATA\[(.*?)\]\]>")
outfile = file(r"language.h", "w")

i = 1

for filename in glob.glob(r"config\*.xml"):
xml = file(filename).read()
for text in finder.findall(xml):
print >> outfile, "#define TASKTEXT%i QObject::tr(\"%s\")" % (i, text.replace('"', r'\"'))
i+=1
50 changes: 26 additions & 24 deletions src/plugins/rename/language.h
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
#define TASKTEXT1 QObject::tr("Change path to \"Artist - Title\" (default)")
#define TASKTEXT2 QObject::tr("All songs will be in the UltraStar song folder with a custom subdirectory for each one.")
#define TASKTEXT3 QObject::tr("Change path to \"Genre/Artist - Title\"")
#define TASKTEXT4 QObject::tr("Songs will be organized in subdirectories by their genres.")
#define TASKTEXT5 QObject::tr("Change path to \"Edition/Artist - Title\"")
#define TASKTEXT6 QObject::tr("Songs will be organized in subdirectories by their edition.")
#define TASKTEXT7 QObject::tr("Change path to \"Artist/Artist - Title\"")
#define TASKTEXT8 QObject::tr("Songs will be organized in subdirectories by their artist.")
#define TASKTEXT9 QObject::tr("Change path to \"Language/Artist - Title\"")
#define TASKTEXT10 QObject::tr("Songs will be organized in subdirectories by their language.")
#define TASKTEXT11 QObject::tr("Change path to \"Artist/Album/Artist - Title\"")
#define TASKTEXT12 QObject::tr("Songs will be organized in subdirectories by their artist and album.<br><b>You need the custom tag #ALBUM for this task.</b>")
#define TASKTEXT13 QObject::tr("Rename directory to \"Artist - Title\"")
#define TASKTEXT14 QObject::tr("Rename directory to \"Artist - Title [VIDEO] [SC]\" if checked or video present, keep other folder tags")
#define TASKTEXT15 QObject::tr("Looks for <b>[SC]</b> in the <b>#EDITION</b> tag to find out whether it is checked or not.<br><br>Other folder tags like <b>[KARAOKE]</b> will be appended to the end if present.")
#define TASKTEXT16 QObject::tr("Rename songtext file to \"Artist - Title.*\"")
#define TASKTEXT17 QObject::tr("Rename songtext file to \"Artist - Title.*\" and use \"txd\" extension for duets")
#define TASKTEXT18 QObject::tr("Rename audio file to \"Artist - Title.*\"")
#define TASKTEXT19 QObject::tr("Rename cover to \"Artist - Title [CO].*\"")
#define TASKTEXT20 QObject::tr("Rename the cover file to a proper schema.<br>File endings will be preserved.")
#define TASKTEXT21 QObject::tr("Rename background to \"Artist - Title [BG].*\"")
#define TASKTEXT22 QObject::tr("Rename video to \"Artist - Title.*\"")
#define TASKTEXT23 QObject::tr("Rename video to \"Artist - Title [VD#*].*\" considering #VIDEOGAP value")
#define TASKTEXT24 QObject::tr("Uses <b>#VIDEOGAP:0</b> if tag not present.")
#define TASKTEXT1 QObject::tr("Change path to \"Artist/Album/Artist - Title\"")
#define TASKTEXT2 QObject::tr("Songs will be organized in subdirectories by their artist and album.<br><b>You need the custom tag #ALBUM for this task.</b>")
#define TASKTEXT3 QObject::tr("Change path to \"Language/Artist - Title\"")
#define TASKTEXT4 QObject::tr("Songs will be organized in subdirectories by their language.")
#define TASKTEXT5 QObject::tr("Change path to \"Artist - Title\" (default)")
#define TASKTEXT6 QObject::tr("All songs will be in the UltraStar song folder with a custom subdirectory for each one.")
#define TASKTEXT7 QObject::tr("Change path to \"Edition/Artist - Title\"")
#define TASKTEXT8 QObject::tr("Songs will be organized in subdirectories by their edition.")
#define TASKTEXT9 QObject::tr("Rename video to \"Artist - Title.*\"")
#define TASKTEXT10 QObject::tr("Change path to \"Artist/Artist - Title\"")
#define TASKTEXT11 QObject::tr("Songs will be organized in subdirectories by their artist.")
#define TASKTEXT12 QObject::tr("Rename background to \"Artist - Title [BG].*\"")
#define TASKTEXT13 QObject::tr("Rename audio file to \"Artist - Title.*\"")
#define TASKTEXT14 QObject::tr("Rename directory to \"Artist - Title [VIDEO] [SC]\" if checked or video present, keep other folder tags")
#define TASKTEXT15 QObject::tr("Looks for <b>[SC]</b> in the <b>#EDITION</b> tag to find out whether it is checked or not.<br><br>Other folder tags like <b>[KARAOKE]</b> will be appended to the end if present.")
#define TASKTEXT16 QObject::tr("Rename directory to \"Artist - Title\"")
#define TASKTEXT17 QObject::tr("Rename vocals file to \"Artist - Title [VOC].*\"")
#define TASKTEXT18 QObject::tr("Rename instrumental file to \"Artist - Title [INSTR].*\"")
#define TASKTEXT19 QObject::tr("Rename video to \"Artist - Title [VD#*].*\" considering #VIDEOGAP value")
#define TASKTEXT20 QObject::tr("Uses <b>#VIDEOGAP:0</b> if tag not present.")
#define TASKTEXT21 QObject::tr("Rename songtext file to \"Artist - Title.*\"")
#define TASKTEXT22 QObject::tr("Rename cover to \"Artist - Title [CO].*\"")
#define TASKTEXT23 QObject::tr("Rename the cover file to a proper schema.<br>File endings will be preserved.")
#define TASKTEXT24 QObject::tr("Change path to \"Genre/Artist - Title\"")
#define TASKTEXT25 QObject::tr("Songs will be organized in subdirectories by their genres.")
#define TASKTEXT26 QObject::tr("Rename songtext file to \"Artist - Title.txt\" and add \" (duet)\" to title for duets")
60 changes: 35 additions & 25 deletions src/plugins/rename/rename.de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,67 +4,77 @@
<context>
<name>QObject</name>
<message>
<location filename="language.h" line="1"/>
<location filename="language.h" line="5"/>
<source>Change path to &quot;Artist - Title&quot; (default)</source>
<translation>Verschiebe Song nach &quot;Interpret - Titel&quot; (Standard)</translation>
</message>
<message>
<location filename="language.h" line="2"/>
<location filename="language.h" line="6"/>
<source>All songs will be in the UltraStar song folder with a custom subdirectory for each one.</source>
<translation>Alle Songs landen im UltraStar-Songordner und erhalten ein eigenes Verzeichnis.</translation>
</message>
<message>
<location filename="language.h" line="3"/>
<location filename="language.h" line="18"/>
<source>Rename instrumental file to &quot;Artist - Title [INSTR].*&quot;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="language.h" line="24"/>
<source>Change path to &quot;Genre/Artist - Title&quot;</source>
<translation>Verschiebe Song nach &quot;Genre/Interpret - Titel&quot;</translation>
</message>
<message>
<location filename="language.h" line="4"/>
<location filename="language.h" line="25"/>
<source>Songs will be organized in subdirectories by their genres.</source>
<translation>Songs werden in Unterverzeichnissen nach ihren Genres organisiert.</translation>
</message>
<message>
<location filename="language.h" line="5"/>
<location filename="language.h" line="26"/>
<source>Rename songtext file to &quot;Artist - Title.txt&quot; and add &quot; (duet)&quot; to title for duets</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="language.h" line="7"/>
<source>Change path to &quot;Edition/Artist - Title&quot;</source>
<translation>Verschiebe Song nach &quot;Edition/Interpret - Titel&quot;</translation>
</message>
<message>
<location filename="language.h" line="6"/>
<location filename="language.h" line="8"/>
<source>Songs will be organized in subdirectories by their edition.</source>
<translation>Songs werden in Unterverzeichnissen nach ihren Editionen organisiert.</translation>
</message>
<message>
<location filename="language.h" line="7"/>
<location filename="language.h" line="10"/>
<source>Change path to &quot;Artist/Artist - Title&quot;</source>
<translation>Verschiebe Song nach &quot;Artist/Interpret - Titel&quot;</translation>
</message>
<message>
<location filename="language.h" line="8"/>
<location filename="language.h" line="11"/>
<source>Songs will be organized in subdirectories by their artist.</source>
<translation>Songs werden in Unterverzeichnissen nach ihren Interpreten organisiert.</translation>
</message>
<message>
<location filename="language.h" line="9"/>
<location filename="language.h" line="3"/>
<source>Change path to &quot;Language/Artist - Title&quot;</source>
<translation>Verschiebe Song nach &quot;Sprache/Interpret - Titel&quot;</translation>
</message>
<message>
<location filename="language.h" line="10"/>
<location filename="language.h" line="4"/>
<source>Songs will be organized in subdirectories by their language.</source>
<translation>Songs werden in Unterverzeichnissen nach ihren Sprachen organisiert.</translation>
</message>
<message>
<location filename="language.h" line="11"/>
<location filename="language.h" line="1"/>
<source>Change path to &quot;Artist/Album/Artist - Title&quot;</source>
<translation>Verschiebe Song nach &quot;Interpret/Album/Interpret - Titel&quot;</translation>
</message>
<message>
<location filename="language.h" line="12"/>
<location filename="language.h" line="2"/>
<source>Songs will be organized in subdirectories by their artist and album.&lt;br&gt;&lt;b&gt;You need the custom tag #ALBUM for this task.&lt;/b&gt;</source>
<translation>Songs werden in Unterverzeichnissen nach ihren Interpreten und Alben organisiert.&lt;br&gt;&lt;b&gt;Der benutzerdefinierte Tag #ALBUM wird benötigt.&lt;/b&gt;</translation>
</message>
<message>
<location filename="language.h" line="13"/>
<location filename="language.h" line="16"/>
<source>Rename directory to &quot;Artist - Title&quot;</source>
<translation>Benenne Ordner um nach &quot;Interpret - Titel&quot;</translation>
</message>
Expand All @@ -81,51 +91,51 @@
<translation>Sucht nach &lt;b&gt;[SC]&lt;/b&gt; im &lt;b&gt;#EDITION&lt;/b&gt;-Tag, um herauszufinden, ob ein Song &quot;checked&quot; ist oder nicht.&lt;br&gt;&lt;br&gt;Andere Ordner-Tags wie &lt;b&gt;[KARAOKE]&lt;/b&gt; bleiben erhalten und werden an den Ordnernamen angehängt.</translation>
</message>
<message>
<location filename="language.h" line="16"/>
<location filename="language.h" line="21"/>
<source>Rename songtext file to &quot;Artist - Title.*&quot;</source>
<oldsource>Rename songtext file to &quot;Artist - Title.txt&quot;</oldsource>
<translation>Benenne Song-Datei um nach &quot;Interpret - Titel.*&quot;</translation>
</message>
<message>
<location filename="language.h" line="17"/>
<source>Rename songtext file to &quot;Artist - Title.*&quot; and use &quot;txd&quot; extension for duets</source>
<oldsource>Rename songtext file to &quot;Artist - Title.*&quot; and use &quot;txd&quot; extension for duets.</oldsource>
<translation>Benenne Song-Datei um nach &quot;Interpret - Titel.*&quot; und verwende &quot;txd&quot; als Erweiterung für Duette</translation>
<source>Rename vocals file to &quot;Artist - Title [VOC].*&quot;</source>
<oldsource>Rename songtext file to &quot;Artist - Title.*&quot; and use &quot;txd&quot; extension for duets</oldsource>
<translation type="unfinished">Benenne Song-Datei um nach &quot;Interpret - Titel.*&quot; und verwende &quot;txd&quot; als Erweiterung für Duette</translation>
</message>
<message>
<location filename="language.h" line="18"/>
<location filename="language.h" line="13"/>
<source>Rename audio file to &quot;Artist - Title.*&quot;</source>
<oldsource>Change duet songtext file to &quot;Artist - Title.txd&quot;</oldsource>
<translation>Benenne Audio-Datei um nach &quot;Interpret - Titel.*&quot;</translation>
</message>
<message>
<location filename="language.h" line="19"/>
<location filename="language.h" line="22"/>
<source>Rename cover to &quot;Artist - Title [CO].*&quot;</source>
<translation>Benenne Cover um nach &quot;Interpret - Titel [CO].*&quot;</translation>
</message>
<message>
<location filename="language.h" line="20"/>
<location filename="language.h" line="23"/>
<source>Rename the cover file to a proper schema.&lt;br&gt;File endings will be preserved.</source>
<translation>Benenne die Bilddatei für das Cover nach einem bestimmten Schema um.&lt;br&gt;Dateiendungen werden beibehalten.</translation>
</message>
<message>
<location filename="language.h" line="21"/>
<location filename="language.h" line="12"/>
<source>Rename background to &quot;Artist - Title [BG].*&quot;</source>
<translation>Benenne Hintergrund um nach &quot;Interpret - Titel [BG].*&quot;</translation>
</message>
<message>
<location filename="language.h" line="22"/>
<location filename="language.h" line="9"/>
<source>Rename video to &quot;Artist - Title.*&quot;</source>
<translation>Benenne Video um nach &quot;Interpret - Titel.*&quot;</translation>
</message>
<message>
<location filename="language.h" line="23"/>
<location filename="language.h" line="19"/>
<source>Rename video to &quot;Artist - Title [VD#*].*&quot; considering #VIDEOGAP value</source>
<oldsource>Rename video to &quot;Artist - Title [VD#*].*&quot; consider VIDEOGAP</oldsource>
<translation>Benenne Video um nach &quot;Interpret - Titel [VD#*].*&quot; unter Beachtung des #VIDEOGAP-Werts</translation>
</message>
<message>
<location filename="language.h" line="24"/>
<location filename="language.h" line="20"/>
<source>Uses &lt;b&gt;#VIDEOGAP:0&lt;/b&gt; if tag not present.</source>
<translation>Wählt &lt;b&gt;#VIDEOGAP:0&lt;/b&gt; wenn dieser Tag fehlt.</translation>
</message>
Expand Down Expand Up @@ -191,7 +201,7 @@
<translation type="obsolete">Wählt &lt;b&gt;#VIDEOGAP:0&lt;/b&gt; wenn dieser Tag fehlt.</translation>
</message>
<message>
<location filename="QURenameTask.cpp" line="110"/>
<location filename="QURenameTask.cpp" line="112"/>
<source>Invalid target: %1</source>
<translation>Ungültiges Ziel: %1</translation>
</message>
Expand Down
Loading
Loading