From b522069d8ee6347c15d294ba245c9cedddcf3ea7 Mon Sep 17 00:00:00 2001 From: geoffrey45 Date: Sun, 31 Jul 2022 10:31:41 +0300 Subject: [PATCH 1/4] delete thumbnails with 0 bytes size --- server/app/lib/albumslib.py | 9 +++++---- server/app/lib/taglib.py | 9 ++++++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/server/app/lib/albumslib.py b/server/app/lib/albumslib.py index eea60e4f..6e196523 100644 --- a/server/app/lib/albumslib.py +++ b/server/app/lib/albumslib.py @@ -37,7 +37,6 @@ class RipAlbumImage: class ValidateAlbumThumbs: - @staticmethod def remove_obsolete(): """ @@ -54,6 +53,10 @@ class ValidateAlbumThumbs: if e is None: os.remove(entry.path) + break + + if os.path.getsize(entry.path) == 0: + os.remove(entry.path) @staticmethod def find_lost_thumbnails(): @@ -61,9 +64,7 @@ class ValidateAlbumThumbs: Re-rip lost album thumbnails """ entries = os.scandir(THUMBS_PATH) - entries = [ - Thumbnail(entry.name) for entry in entries if entry.is_file() - ] + entries = [Thumbnail(entry.name) for entry in entries if entry.is_file()] albums = helpers.Get.get_all_albums() thumbs = [(album.hash + ".webp") for album in albums] diff --git a/server/app/lib/taglib.py b/server/app/lib/taglib.py index 4770035d..8cd6280e 100644 --- a/server/app/lib/taglib.py +++ b/server/app/lib/taglib.py @@ -9,7 +9,7 @@ from mutagen.id3 import ID3 from PIL import Image -def return_album_art(filepath: str): +def parse_album_art(filepath: str): """ Returns the album art for a given audio file. """ @@ -36,9 +36,12 @@ def extract_thumb(filepath: str, webp_path: str) -> bool: tsize = settings.THUMB_SIZE if os.path.exists(img_path): - return True + img_size = os.path.getsize(filepath) - album_art = return_album_art(filepath) + if img_size > 0: + return True + + album_art = parse_album_art(filepath) if album_art is not None: img = Image.open(BytesIO(album_art)) From 8fa0516b56b379c2235ac06d9487bc3a8dac91cd Mon Sep 17 00:00:00 2001 From: geoffrey45 Date: Mon, 1 Aug 2022 00:23:39 +0300 Subject: [PATCH 2/4] improve component spacing + bump up folder and album page gap to ~ 1rem + test out noise texture on album img on album page + ~ although i'm still annoyed about the scrollbar space irregularities (will fix someday) --- src/App.vue | 7 --- src/assets/css/global.scss | 37 +++++------ src/assets/css/moz.scss | 16 +++++ src/assets/images/noise-texture.svg | 78 ++++++++++++++++++++++++ src/components/AlbumView/Header.vue | 7 +++ src/components/FolderView/FolderList.vue | 29 ++++----- src/components/FolderView/SongList.vue | 3 +- src/components/shared/SongItem.vue | 2 +- src/layouts/HeaderContentBottom.vue | 37 +++++------ src/views/FolderView.vue | 2 +- 10 files changed, 155 insertions(+), 63 deletions(-) create mode 100644 src/assets/css/moz.scss create mode 100644 src/assets/images/noise-texture.svg diff --git a/src/App.vue b/src/App.vue index 34f63140..c38cf0c8 100644 --- a/src/App.vue +++ b/src/App.vue @@ -94,11 +94,4 @@ onStartTyping(() => { display: none; } } - -.content { - padding: 0 $small; - margin-top: $small; - overflow: auto; - padding-right: $small !important; -} diff --git a/src/assets/css/global.scss b/src/assets/css/global.scss index 5cd5d38f..4b126bc2 100644 --- a/src/assets/css/global.scss +++ b/src/assets/css/global.scss @@ -1,5 +1,6 @@ @import "../css/ProgressBar.scss"; @import "mixins.scss"; +@import "./moz.scss"; :root { --separator: #ffffff46; @@ -85,11 +86,26 @@ a { max-width: 2720px; height: 100vh; margin: 0 auto; + gap: $small; +} + +#acontent { + grid-area: content; + width: calc(100% + $small); + max-width: 1955px; + overflow: hidden auto; + margin: 0 auto; + padding-right: $medium; + margin-bottom: $small; + + .nav { + margin: $small; + width: calc(100% - 1rem); + } } .tabs { grid-area: tabs; - border-left: solid 1px $gray3; @include tablet-landscape { display: none; @@ -137,24 +153,9 @@ a { display: flex; } -#acontent { - grid-area: content; - width: 100%; - max-width: 1955px; - padding: $small; - padding-left: 0; - overflow: auto; - margin: 0 auto; - - .nav { - margin: $small; - width: calc(100% - 1rem); - } -} - .r-sidebar { grid-area: r-sidebar; - border-left: solid 1px $gray3; + // border-left: solid 1px $gray3; } .image { @@ -187,7 +188,7 @@ a { /* width */ ::-webkit-scrollbar { - width: 0.5rem; + width: 3px; } /* Track */ diff --git a/src/assets/css/moz.scss b/src/assets/css/moz.scss new file mode 100644 index 00000000..72b6c623 --- /dev/null +++ b/src/assets/css/moz.scss @@ -0,0 +1,16 @@ +// Styles that only apply on our dear Firefox + +@-moz-document url-prefix() { + #acontent { + padding-right: 1rem !important; + } + + #ap-page { + width: 100% !important; + padding-right: 1rem !important; + } + + .ap-page-bottom-container { + width: calc(100% - 1rem) !important; + } +} diff --git a/src/assets/images/noise-texture.svg b/src/assets/images/noise-texture.svg new file mode 100644 index 00000000..8acc4de0 --- /dev/null +++ b/src/assets/images/noise-texture.svg @@ -0,0 +1,78 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/src/components/AlbumView/Header.vue b/src/components/AlbumView/Header.vue index 6bf05e8e..45abe96d 100644 --- a/src/components/AlbumView/Header.vue +++ b/src/components/AlbumView/Header.vue @@ -15,6 +15,7 @@ v-motion-slide-from-left class="rounded shadow-lg" /> +
@@ -187,6 +188,7 @@ function theyContrast(color1: string, color2: string) { .art { display: flex; align-items: flex-end; + position: relative; img { height: 16rem; @@ -194,6 +196,11 @@ function theyContrast(color1: string, color2: string) { object-fit: cover; transition: all 0.2s ease-in-out; } + + .filter { + position: absolute; + // display: none; + } } .nocontrast { diff --git a/src/components/FolderView/FolderList.vue b/src/components/FolderView/FolderList.vue index fd9cc654..f438e7c8 100644 --- a/src/components/FolderView/FolderList.vue +++ b/src/components/FolderView/FolderList.vue @@ -1,37 +1,32 @@ - diff --git a/src/components/FolderView/SongList.vue b/src/components/FolderView/SongList.vue index 34b10c85..c8a56221 100644 --- a/src/components/FolderView/SongList.vue +++ b/src/components/FolderView/SongList.vue @@ -130,9 +130,10 @@ function getTracks() { } .table { - width: 100%; height: 100%; overflow-y: hidden; + background-color: $gray5; + padding: $small 0; .current { a { diff --git a/src/components/shared/SongItem.vue b/src/components/shared/SongItem.vue index ac1e8bc9..56405594 100644 --- a/src/components/shared/SongItem.vue +++ b/src/components/shared/SongItem.vue @@ -1,6 +1,6 @@