mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 20:43:04 +00:00
fix folder tracks being None
This commit is contained in:
@@ -119,9 +119,6 @@ def search_load_more():
|
|||||||
type = request.args.get("type")
|
type = request.args.get("type")
|
||||||
index = int(request.args.get("index"))
|
index = int(request.args.get("index"))
|
||||||
|
|
||||||
print(type, index)
|
|
||||||
print(len(SEARCH_RESULTS["tracks"]))
|
|
||||||
|
|
||||||
if type == "tracks":
|
if type == "tracks":
|
||||||
return {
|
return {
|
||||||
"tracks": SEARCH_RESULTS["tracks"][index:index + 5],
|
"tracks": SEARCH_RESULTS["tracks"][index:index + 5],
|
||||||
|
|||||||
@@ -62,11 +62,8 @@ def find_album(albums: List[models.Album], hash: str) -> int | None:
|
|||||||
while left <= right:
|
while left <= right:
|
||||||
mid = (left + right) // 2
|
mid = (left + right) // 2
|
||||||
|
|
||||||
try:
|
if albums[mid].hash == hash:
|
||||||
if albums[mid].hash == hash:
|
return mid
|
||||||
return mid
|
|
||||||
except AttributeError:
|
|
||||||
print(albums)
|
|
||||||
|
|
||||||
if albums[mid].hash < hash:
|
if albums[mid].hash < hash:
|
||||||
left = mid + 1
|
left = mid + 1
|
||||||
|
|||||||
@@ -104,7 +104,9 @@ class getFnF:
|
|||||||
"""
|
"""
|
||||||
Returns a list of Track objects for each file in the given list.
|
Returns a list of Track objects for each file in the given list.
|
||||||
"""
|
"""
|
||||||
return helpers.UseBisection(api.TRACKS, "filepath", files)()
|
tracks = helpers.UseBisection(api.TRACKS, "filepath", files)()
|
||||||
|
tracks = filter(lambda t: t is not None, tracks)
|
||||||
|
return list(tracks)
|
||||||
|
|
||||||
def __call__(self) -> Tuple[Track, Folder]:
|
def __call__(self) -> Tuple[Track, Folder]:
|
||||||
try:
|
try:
|
||||||
@@ -128,4 +130,4 @@ class getFnF:
|
|||||||
folders = [create_folder(dir) for dir in dirs]
|
folders = [create_folder(dir) for dir in dirs]
|
||||||
folders = filter(lambda f: f.trackcount > 0, folders)
|
folders = filter(lambda f: f.trackcount > 0, folders)
|
||||||
|
|
||||||
return (tracks, folders)
|
return tracks, folders
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ def date_string_to_time_passed(prev_date: str) -> str:
|
|||||||
|
|
||||||
diff = now - then
|
diff = now - then
|
||||||
days = diff.days
|
days = diff.days
|
||||||
print(days)
|
|
||||||
|
|
||||||
if days < 0:
|
if days < 0:
|
||||||
return "in the future"
|
return "in the future"
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ $gray5: rgb(44, 44, 46);
|
|||||||
|
|
||||||
$red: #FF453A;
|
$red: #FF453A;
|
||||||
$blue: #0A84FF;
|
$blue: #0A84FF;
|
||||||
|
$darkblue: #055ee2;
|
||||||
$green: rgb(20, 160, 55);
|
$green: rgb(20, 160, 55);
|
||||||
$yellow: rgb(255, 214, 10);
|
$yellow: rgb(255, 214, 10);
|
||||||
$orange: rgb(255, 159, 10);
|
$orange: rgb(255, 159, 10);
|
||||||
@@ -36,9 +37,10 @@ $brown: rgb(172, 142, 104);
|
|||||||
$indigo: #5E5CE6;
|
$indigo: #5E5CE6;
|
||||||
$teal: rgb(64, 200, 224);
|
$teal: rgb(64, 200, 224);
|
||||||
|
|
||||||
// 60 30 10
|
|
||||||
$primary: $gray4;
|
$primary: $gray4;
|
||||||
$accent: $indigo;
|
$accent: $darkblue;
|
||||||
|
$secondary: $gray5;
|
||||||
$cta: $blue;
|
$cta: $blue;
|
||||||
$danger: $red;
|
$danger: $red;
|
||||||
$track-hover: $gray4;
|
$track-hover: $gray4;
|
||||||
|
|||||||
@@ -131,10 +131,12 @@ a {
|
|||||||
|
|
||||||
#acontent {
|
#acontent {
|
||||||
grid-area: content;
|
grid-area: content;
|
||||||
|
width: 100%;
|
||||||
max-width: 1504px;
|
max-width: 1504px;
|
||||||
padding: $small;
|
padding: $small;
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
margin: 0 auto;
|
||||||
|
|
||||||
.nav {
|
.nav {
|
||||||
margin: $small;
|
margin: $small;
|
||||||
|
|||||||
@@ -10,13 +10,13 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="songlist">
|
<div class="songlist">
|
||||||
<SongItem
|
<SongItem
|
||||||
v-for="(song, index) in tracks"
|
v-for="(track, index) in tracks"
|
||||||
:key="song.trackid"
|
:key="track.trackid"
|
||||||
:song="song"
|
:song="track"
|
||||||
:index="index + 1"
|
:index="index + 1"
|
||||||
@updateQueue="updateQueue"
|
@updateQueue="updateQueue"
|
||||||
:isPlaying="queue.playing"
|
:isPlaying="queue.playing"
|
||||||
:isCurrent="queue.current.trackid == song.trackid"
|
:isCurrent="queue.current.trackid == track.trackid"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user