Bladeren bron

Merge branch 'master' of https://git.xorion.net/olinox14/mew

olinox 4 jaren geleden
bovenliggende
commit
301ab1f363

+ 3 - 3
core/file_utilities.py

@@ -44,10 +44,10 @@ def is_subdir_of(subject, other):
 
 def open_file(path_):
     if sys.platform == 'darwin':
-        subprocess.check_call(['open', str(path_)])
+        subprocess.check_call(['open', path_.abspath()])
     elif sys.platform == 'linux':
-        subprocess.check_call(['xdg-open', str(path_)])
+        subprocess.check_call(['xdg-open', path_.abspath()])
     elif sys.platform == 'win32':
-        subprocess.check_call(['explorer', str(path_)])
+        subprocess.check_call(['explorer', path_.abspath()])
     else:
         raise RuntimeError(f"Unsupported platform {sys.platform}")

+ 10 - 5
core/indexer.py

@@ -56,7 +56,7 @@ class Indexer(Thread):
         buffer = deque()
 
         # -- Walk through music folders
-        # Index new files
+        # Put new files in buffer
         for music_folder in music_folders:
             music_folder_path = Path(music_folder.path)
 
@@ -89,7 +89,7 @@ class Indexer(Thread):
                         buffer.append(track.id)
                     del index[filename]
 
-        # Index missing files
+        # Put missing files in buffer
         for filename, track in index.items():
             if track.id in buffer:
                 continue
@@ -104,7 +104,7 @@ class Indexer(Thread):
         while buffer:
             filename_or_id = buffer.pop()
             try:
-                track = self.index(track_repo, filename_or_id)
+                track = self.index(track_repo, filename_or_id, tracks)
                 tracks.append(track)
             except AlreadyIndexed:
                 pass
@@ -124,9 +124,11 @@ class Indexer(Thread):
             logger.info(f"{len(tracks)} tracks indexed")
 
     @staticmethod
-    def index(track_repo, filename_or_track_id):
+    def index(track_repo, filename_or_track_id, previously_indexed=None):
         """ index a media file from the filesystem or a track id """
 
+        previously_indexed = previously_indexed or []
+
         if type(filename_or_track_id) is int:
             track = track_repo.get_by_id(filename_or_track_id)
             filename = Path(track.path)
@@ -145,6 +147,9 @@ class Indexer(Thread):
 
             track_hash = hash_file(filename)
 
+            if any(t.hash == track_hash for t in previously_indexed):
+                raise AlreadyIndexed(f"File already indexed")
+
             track = track_repo.get_by_hash(track_hash)
             if not track:
                 track = Track()
@@ -155,7 +160,7 @@ class Indexer(Thread):
         vlc_media.parse()
 
         title = vlc_media.get_meta(vlc.Meta.Title)
-        if not title or title == '(null)':
+        if not title or title == '(null)' or title == filename.name:
             title = filename.stripext().name
         track.title = title
         track.format = filename.ext

+ 1 - 0
core/vlc-core/plugins/.gitignore

@@ -0,0 +1 @@
+/plugins.dat

BIN
core/vlc-core/plugins/plugins.dat


+ 1 - 1
ui/qt/dlg_meta_editor.py

@@ -28,7 +28,7 @@ class DlgMetaEditor(QtWidgets.QDialog):
 
         self.ui.lineTrackNum.setValidator(QIntValidator())
 
-        self.ui.lblPath.setText(self.track.path)
+        self.ui.lblPath.setText(self.track.path.abspath())
 
         if self.track.status != Track.STATUS_UNAVAILABLE:
             self.ui.btnOpenTrackFolder.clicked.connect(self.openTrackFolder)

+ 1 - 1
ui/qt/dlg_meta_editor_ui.py

@@ -2,7 +2,7 @@
 
 # Form implementation generated from reading ui file 'dlg_meta_editor.ui'
 #
-# Created by: PyQt5 UI code generator 5.15.4
+# Created by: PyQt5 UI code generator 5.15.2
 #
 # WARNING: Any manual changes made to this file will be lost when pyuic5 is
 # run again.  Do not edit this file unless you know what you are doing.

+ 1 - 1
ui/qt/dlg_playlist_ui.py

@@ -2,7 +2,7 @@
 
 # Form implementation generated from reading ui file 'dlg_playlist.ui'
 #
-# Created by: PyQt5 UI code generator 5.15.4
+# Created by: PyQt5 UI code generator 5.15.2
 #
 # WARNING: Any manual changes made to this file will be lost when pyuic5 is
 # run again.  Do not edit this file unless you know what you are doing.

+ 1 - 1
ui/qt/dlg_select_playlist_ui.py

@@ -2,7 +2,7 @@
 
 # Form implementation generated from reading ui file 'dlg_select_playlist.ui'
 #
-# Created by: PyQt5 UI code generator 5.15.4
+# Created by: PyQt5 UI code generator 5.15.2
 #
 # WARNING: Any manual changes made to this file will be lost when pyuic5 is
 # run again.  Do not edit this file unless you know what you are doing.

+ 1 - 1
ui/qt/dlg_tag_editor_ui.py

@@ -2,7 +2,7 @@
 
 # Form implementation generated from reading ui file 'dlg_tag_editor.ui'
 #
-# Created by: PyQt5 UI code generator 5.15.4
+# Created by: PyQt5 UI code generator 5.15.2
 #
 # WARNING: Any manual changes made to this file will be lost when pyuic5 is
 # run again.  Do not edit this file unless you know what you are doing.

+ 1 - 1
ui/qt/dlg_tag_ui.py

@@ -2,7 +2,7 @@
 
 # Form implementation generated from reading ui file 'dlg_tag.ui'
 #
-# Created by: PyQt5 UI code generator 5.15.4
+# Created by: PyQt5 UI code generator 5.15.2
 #
 # WARNING: Any manual changes made to this file will be lost when pyuic5 is
 # run again.  Do not edit this file unless you know what you are doing.

+ 1 - 1
ui/qt/main_ui.py

@@ -2,7 +2,7 @@
 
 # Form implementation generated from reading ui file 'main.ui'
 #
-# Created by: PyQt5 UI code generator 5.15.4
+# Created by: PyQt5 UI code generator 5.15.2
 #
 # WARNING: Any manual changes made to this file will be lost when pyuic5 is
 # run again.  Do not edit this file unless you know what you are doing.

File diff suppressed because it is too large
+ 1432 - 1098
ui/qt/rsc_rc.py


+ 1 - 1
ui/qt/widgets/frame_notes_ui.py

@@ -2,7 +2,7 @@
 
 # Form implementation generated from reading ui file 'widgets/frame_notes.ui'
 #
-# Created by: PyQt5 UI code generator 5.15.4
+# Created by: PyQt5 UI code generator 5.15.2
 #
 # WARNING: Any manual changes made to this file will be lost when pyuic5 is
 # run again.  Do not edit this file unless you know what you are doing.

+ 1 - 1
ui/qt/widgets/playlist_table.py

@@ -85,7 +85,7 @@ class PlaylistTable(SQTableWidget):
             i += 1
         self.count = i
 
-        self.sortItems(3)
+        self.sortItems(4)
 
         self.setUpdatesEnabled(True)
 

+ 1 - 1
ui/qt/widgets/vlcframe_ui.py

@@ -2,7 +2,7 @@
 
 # Form implementation generated from reading ui file 'widgets/vlcframe.ui'
 #
-# Created by: PyQt5 UI code generator 5.15.4
+# Created by: PyQt5 UI code generator 5.15.2
 #
 # WARNING: Any manual changes made to this file will be lost when pyuic5 is
 # run again.  Do not edit this file unless you know what you are doing.

Some files were not shown because too many files changed in this diff