Closed cwilvx closed 2 years ago
If #57 goes through, this might not be a problem.
Apparently, #57 went through but this issue is partly solved. The folders no longer appear inside each other (because we are now reading the fiesystem) but the folder-track count is still an issue. The track counter function looks like this.
def get_folder_track_count(foldername: str) -> int:
"""
Returns the number of files associated with a folder.
"""
count = 0
for track in api.TRACKS:
if foldername in track.folder:
count += 1
return count
The above issue was fixed by implementing the counter with pymongo's count_documents()
.
Folders count is still wrong in cases described in the PR description. This is because counting documents return documents that match this regex rule:
'^path'
Since The Police
is inside The Police - Brah brah brah
, the track count will remain to be incorrect.
Partially fixed, no readily available fix (unless optionally disabling folder counting which means not being able to filter dirs with tracks using data in the database)
Given the following folder structure:
The paths inside
The Police - Remastered
appear insideThe Police
sinceThe Police
is common to both and they are on the same level.I'll fix this ASAP.