@@ -379,3 +379,16 @@ bool CueParser::TryMagic(const QByteArray &data) const {
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
QString CueParser::FindCueFilename(const QString &filename) {
|
||||
|
||||
QStringList cue_files = QStringList() << filename + ".cue"
|
||||
<< filename.section('.', 0, -2) + ".cue";
|
||||
|
||||
for (const QString &cuefile : cue_files) {
|
||||
if (QFileInfo::exists(cuefile)) return cuefile;
|
||||
}
|
||||
|
||||
return QString();
|
||||
|
||||
}
|
||||
|
||||
@@ -70,6 +70,8 @@ class CueParser : public ParserBase {
|
||||
SongList Load(QIODevice *device, const QString &playlist_path = "", const QDir &dir = QDir(), const bool collection_search = true) const override;
|
||||
void Save(const SongList &songs, QIODevice *device, const QDir &dir = QDir(), Playlist::Path path_type = Playlist::Path_Automatic) const override;
|
||||
|
||||
static QString FindCueFilename(const QString &filename);
|
||||
|
||||
private:
|
||||
// A single TRACK entry in .cue file.
|
||||
struct CueEntry {
|
||||
|
||||
Reference in New Issue
Block a user