fix folder count

+ fix: file count when you have similar folder names
+ enforce trailing / on track folder paths
This commit is contained in:
mungai-njoroge
2024-04-07 19:19:48 +03:00
parent 14f3479baa
commit 4b04b8b155
5 changed files with 45 additions and 12 deletions
+6
View File
@@ -1,4 +1,5 @@
from dataclasses import dataclass
import os
from pathlib import Path
from app.settings import SessionVarKeys, get_flag
@@ -61,6 +62,11 @@ class Track:
self.last_mod = int(self.last_mod)
self.date = int(self.date)
# add a trailing slash to the folder path
# to avoid matching a folder starting with the same name as the root path
# eg. .../Music and .../Music Videos
self.folder = os.path.join(self.folder, "")
if self.artists is not None:
artists = split_artists(self.artists)
new_title = self.title