mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-05 04:53:01 +00:00
rename find_tracks_inside_path_regex -> get_dir_t_count
This commit is contained in:
@@ -207,7 +207,7 @@ class TrackMethods:
|
|||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def find_tracks_inside_path_regex():
|
def get_dir_t_count():
|
||||||
"""
|
"""
|
||||||
Returns a list of all the tracks matching the path in the query params.
|
Returns a list of all the tracks matching the path in the query params.
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -2,10 +2,9 @@
|
|||||||
This file contains the AllSongs class for interacting with track documents in MongoDB.
|
This file contains the AllSongs class for interacting with track documents in MongoDB.
|
||||||
"""
|
"""
|
||||||
import re
|
import re
|
||||||
|
|
||||||
import pymongo
|
import pymongo
|
||||||
from app.db.mongodb import convert_many
|
from app.db.mongodb import MongoTracks, convert_many, convert_one
|
||||||
from app.db.mongodb import convert_one
|
|
||||||
from app.db.mongodb import MongoTracks
|
|
||||||
from bson import ObjectId
|
from bson import ObjectId
|
||||||
|
|
||||||
|
|
||||||
@@ -100,7 +99,7 @@ class Tracks(MongoTracks):
|
|||||||
songs = self.collection.find({"folder": query})
|
songs = self.collection.find({"folder": query})
|
||||||
return convert_many(songs)
|
return convert_many(songs)
|
||||||
|
|
||||||
def find_tracks_inside_path_regex(self, path: str) -> int:
|
def get_dir_t_count(self, path: str) -> int:
|
||||||
"""
|
"""
|
||||||
Returns a list of all the tracks matching the path in the query params.
|
Returns a list of all the tracks matching the path in the query params.
|
||||||
"""
|
"""
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ def get_folder_track_count(path: str) -> int:
|
|||||||
"""
|
"""
|
||||||
Returns the number of files associated with a folder.
|
Returns the number of files associated with a folder.
|
||||||
"""
|
"""
|
||||||
tracks = instances.tracks_instance.find_tracks_inside_path_regex(path)
|
tracks = instances.tracks_instance.get_dir_t_count(path)
|
||||||
return len(tracks)
|
return len(tracks)
|
||||||
|
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ def create_folder(dir: Dir) -> Folder:
|
|||||||
"name": dir.path.split("/")[-1],
|
"name": dir.path.split("/")[-1],
|
||||||
"path": dir.path,
|
"path": dir.path,
|
||||||
"is_sym": dir.is_sym,
|
"is_sym": dir.is_sym,
|
||||||
"trackcount": instances.tracks_instance.find_tracks_inside_path_regex(dir.path),
|
"trackcount": instances.tracks_instance.get_dir_t_count(dir.path),
|
||||||
}
|
}
|
||||||
|
|
||||||
return Folder(folder)
|
return Folder(folder)
|
||||||
|
|||||||
Reference in New Issue
Block a user