Compare commits

..

No commits in common. "41379efd1ba4af8f07c67b3113946d8bca1b9864" and "a0c1dad2f566f1be338fe9e0f8f6a4d952a357f5" have entirely different histories.

3 changed files with 10 additions and 15 deletions

View File

@ -65,7 +65,6 @@ class Config(object):
MAIL_SERVER = os.environ.get('MAIL_SERVER') or "woodlands.midnighthax.com" MAIL_SERVER = os.environ.get('MAIL_SERVER') or "woodlands.midnighthax.com"
MAIL_USERNAME = os.environ.get('MAIL_USERNAME') MAIL_USERNAME = os.environ.get('MAIL_USERNAME')
MAIL_USE_TLS = os.environ.get('MAIL_USE_TLS') is not None MAIL_USE_TLS = os.environ.get('MAIL_USE_TLS') is not None
MAX_IMPORT_MATCHES = 5
MAX_INFO_TABS = 5 MAX_INFO_TABS = 5
MAX_MISSING_FILES_TO_REPORT = 10 MAX_MISSING_FILES_TO_REPORT = 10
MILLISECOND_SIGFIGS = 0 MILLISECOND_SIGFIGS = 0

View File

@ -668,18 +668,17 @@ class Window(QMainWindow, Ui_MainWindow):
new_tracks.append((fname, tags)) new_tracks.append((fname, tags))
title = tags['title'] title = tags['title']
artist = tags['artist'] artist = tags['artist']
count = 0
possible_matches = Tracks.search_titles(session, title) possible_matches = Tracks.search_titles(session, title)
if possible_matches: if possible_matches:
txt += 'Similar to new track ' if len(possible_matches) > 5:
txt += f'"{title}" by "{artist} ({fname})":\n\n' txt = "More than five tracks look similar to "
for track in possible_matches: txt += f'"{title}" by "{artist} ({fname})":\n\n'
txt += f' "{track.title}" by {track.artist}' else:
txt += f' ({track.path})\n\n' txt += 'Similar to new track '
count += 1 txt += f'"{title}" by "{artist} ({fname})":\n\n'
if count >= Config.MAX_IMPORT_MATCHES: for track in possible_matches:
txt += "\nThere are more similar-looking tracks" txt += f' "{track.title}" by {track.artist}'
break txt += f' ({track.path})\n\n'
txt += "\n" txt += "\n"
# Check whether to proceed if there were potential matches # Check whether to proceed if there were potential matches
txt += "Proceed with import?" txt += "Proceed with import?"

View File

@ -737,7 +737,7 @@ class PlaylistTab(QTableWidget):
next_row = self._find_next_track_row(session, search_from) next_row = self._find_next_track_row(session, search_from)
if next_row: if next_row:
self._set_next(session, next_row) self._set_next(session, next_row)
self._scroll_to_top(next_row) self._scroll_to_top(next_row)
# Update display # Update display
self.update_display(session) self.update_display(session)
@ -1727,9 +1727,6 @@ class PlaylistTab(QTableWidget):
top. top.
""" """
if row is None:
return
padding_required = Config.SCROLL_TOP_MARGIN padding_required = Config.SCROLL_TOP_MARGIN
top_row = row top_row = row