- When guessing tags, remove leading spaces/dashes from title.
- Also add tag/title guessing to details shown in main window.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
6. For playqueue items, if we only have a filename, and no artist, etc, then
|
||||
attempt to ascertain artist, album, title, and track number from the
|
||||
filename. These will be extracted if the filename has the following pattern:
|
||||
"%artist%/%album%/%track% %title"
|
||||
"%artist%/%album%/%track% %title%"
|
||||
Otherwise, if we cannot extract all of these, just set the title to the
|
||||
filename without path.
|
||||
7. Allow editing of tags, and replaygain calculation, of files from folder view
|
||||
|
||||
@@ -1782,10 +1782,14 @@ void MainWindow::updateCurrentSong(const Song &song)
|
||||
}
|
||||
#endif
|
||||
|
||||
if (current.isEmpty()) {
|
||||
current.guessTags();
|
||||
current.fillEmptyFields();
|
||||
}
|
||||
positionSlider->setEnabled(-1!=current.id && !currentIsStream());
|
||||
coverWidget->update(current);
|
||||
|
||||
if (song.title.isEmpty() && song.artist.isEmpty() && !song.file.isEmpty()) {
|
||||
if (current.title.isEmpty() && current.artist.isEmpty() && !current.file.isEmpty()) {
|
||||
trackLabel->setText(current.file);
|
||||
} else if (current.name.isEmpty()) {
|
||||
trackLabel->setText(current.title);
|
||||
|
||||
@@ -174,6 +174,10 @@ void Song::guessTags()
|
||||
(2==space && title[space-2].isDigit() && title[space-1].isDigit()) ) {
|
||||
track=title.left(space).toInt();
|
||||
title=title.mid(space+1);
|
||||
|
||||
while (!title.isEmpty() && (title[0]==' ' || title[0]=='-')) {
|
||||
title=title.mid(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user