mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 04:23:01 +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")
|
||||
index = int(request.args.get("index"))
|
||||
|
||||
print(type, index)
|
||||
print(len(SEARCH_RESULTS["tracks"]))
|
||||
|
||||
if type == "tracks":
|
||||
return {
|
||||
"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:
|
||||
mid = (left + right) // 2
|
||||
|
||||
try:
|
||||
if albums[mid].hash == hash:
|
||||
return mid
|
||||
except AttributeError:
|
||||
print(albums)
|
||||
if albums[mid].hash == hash:
|
||||
return mid
|
||||
|
||||
if albums[mid].hash < hash:
|
||||
left = mid + 1
|
||||
|
||||
@@ -104,7 +104,9 @@ class getFnF:
|
||||
"""
|
||||
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]:
|
||||
try:
|
||||
@@ -128,4 +130,4 @@ class getFnF:
|
||||
folders = [create_folder(dir) for dir in dirs]
|
||||
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
|
||||
days = diff.days
|
||||
print(days)
|
||||
|
||||
if days < 0:
|
||||
return "in the future"
|
||||
|
||||
@@ -27,6 +27,7 @@ $gray5: rgb(44, 44, 46);
|
||||
|
||||
$red: #FF453A;
|
||||
$blue: #0A84FF;
|
||||
$darkblue: #055ee2;
|
||||
$green: rgb(20, 160, 55);
|
||||
$yellow: rgb(255, 214, 10);
|
||||
$orange: rgb(255, 159, 10);
|
||||
@@ -36,9 +37,10 @@ $brown: rgb(172, 142, 104);
|
||||
$indigo: #5E5CE6;
|
||||
$teal: rgb(64, 200, 224);
|
||||
|
||||
// 60 30 10
|
||||
|
||||
$primary: $gray4;
|
||||
$accent: $indigo;
|
||||
$accent: $darkblue;
|
||||
$secondary: $gray5;
|
||||
$cta: $blue;
|
||||
$danger: $red;
|
||||
$track-hover: $gray4;
|
||||
|
||||
@@ -131,10 +131,12 @@ a {
|
||||
|
||||
#acontent {
|
||||
grid-area: content;
|
||||
width: 100%;
|
||||
max-width: 1504px;
|
||||
padding: $small;
|
||||
padding-left: 0;
|
||||
overflow: auto;
|
||||
margin: 0 auto;
|
||||
|
||||
.nav {
|
||||
margin: $small;
|
||||
|
||||
@@ -10,13 +10,13 @@
|
||||
</div>
|
||||
<div class="songlist">
|
||||
<SongItem
|
||||
v-for="(song, index) in tracks"
|
||||
:key="song.trackid"
|
||||
:song="song"
|
||||
v-for="(track, index) in tracks"
|
||||
:key="track.trackid"
|
||||
:song="track"
|
||||
:index="index + 1"
|
||||
@updateQueue="updateQueue"
|
||||
:isPlaying="queue.playing"
|
||||
:isCurrent="queue.current.trackid == song.trackid"
|
||||
:isCurrent="queue.current.trackid == track.trackid"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user