Restyle Add edit playlist modal (#28)

* Restyled by black

* Restyled by clang-format

* Restyled by isort

* Restyled by prettier

* Restyled by prettier-markdown

* Restyled by reorder-python-imports

* Restyled by whitespace

* Restyled by yapf

Co-authored-by: Restyled.io <commits@restyled.io>
This commit is contained in:
restyled-io[bot] 2022-04-09 02:19:27 +03:00 committed by GitHub
parent bf6aaea4ff
commit 2e512bc223
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 21 additions and 6 deletions

View File

@ -7,27 +7,33 @@ Although it's quite usable, it's not quite ready for use yet. I'm working on get
Assuming you won't look at those broken buttons twice, here are some screenshots of the current state of the app: Assuming you won't look at those broken buttons twice, here are some screenshots of the current state of the app:
### 1. The folder page ### 1. The folder page
![](./images/1.png) ![](./images/1.png)
This pages allows you to navigate through your music folders the same way you would on your computer. It doesn't show the directories without playable files. At this point, only FLAC and MP3 files are supported. (For experimenting purposes only, other formats will be added before the stable release) This pages allows you to navigate through your music folders the same way you would on your computer. It doesn't show the directories without playable files. At this point, only FLAC and MP3 files are supported. (For experimenting purposes only, other formats will be added before the stable release)
### 2. The Album page ### 2. The Album page
![](./images/3.png) ![](./images/3.png)
This page shows the album details including tracks, album artist, featured artists and Last FM album bio. The UI may look a bit rough but it will do for now. This page shows the album details including tracks, album artist, featured artists and Last FM album bio. The UI may look a bit rough but it will do for now.
### 3. The Playlists list page ### 3. The Playlists list page
![](./images/4.png) ![](./images/4.png)
This page lists all the playlists you have created. More features will be added to this page in the future. These "might" include Folders, Search, etc. This page lists all the playlists you have created. More features will be added to this page in the future. These "might" include Folders, Search, etc.
### 4. The Playlist page ### 4. The Playlist page
![](./images/2.png) ![](./images/2.png)
This page shows the details of the playlist. It includes the playlist name, description, and the songs in the playlist. You can update your playlist details from this page. This page shows the details of the playlist. It includes the playlist name, description, and the songs in the playlist. You can update your playlist details from this page.
### A little narration ### A little narration
The app features two sidebars. The one on the left and one on the right. The left sidebar is the classic navigation bar while the right sidebar acts as a quick access menu. The queue and the global search components are fixed here. Although they might switch to other locations in the future, the current position will work for now. The app features two sidebars. The one on the left and one on the right. The left sidebar is the classic navigation bar while the right sidebar acts as a quick access menu. The queue and the global search components are fixed here. Although they might switch to other locations in the future, the current position will work for now.
Here are some other functional features already implemented: Here are some other functional features already implemented:
- Track context menu - Track context menu
- Global search (😅 buggy as fuck) - Global search (😅 buggy as fuck)
- Basic playback controls - Basic playback controls
@ -36,7 +42,9 @@ Here are some other functional features already implemented:
There may be a few more, but I can't remember them at the moment. There may be a few more, but I can't remember them at the moment.
### Dev Setup ### Dev Setup
I'm working on this section. I'll be adding instructions soon. Please check back later! I'm working on this section. I'll be adding instructions soon. Please check back later!
### Contributing ### Contributing
The app runs on Python, Vue, Flask, MongoDB and Nginx. If you want to contribute, please open an issue or pull request. Your contribution is highly valued. The app runs on Python, Vue, Flask, MongoDB and Nginx. If you want to contribute, please open an issue or pull request. Your contribution is highly valued.

View File

@ -2,6 +2,7 @@
Contains all the playlist routes. Contains all the playlist routes.
""" """
from datetime import datetime from datetime import datetime
from app import api from app import api
from app import exceptions from app import exceptions
from app import instances from app import instances
@ -20,7 +21,8 @@ TrackExistsInPlaylist = exceptions.TrackExistsInPlaylist
@playlist_bp.route("/playlists", methods=["GET"]) @playlist_bp.route("/playlists", methods=["GET"])
def get_all_playlists(): def get_all_playlists():
playlists = [ playlists = [
serializer.Playlist(p, construct_last_updated=False) for p in api.PLAYLISTS serializer.Playlist(p, construct_last_updated=False)
for p in api.PLAYLISTS
] ]
playlists.sort( playlists.sort(
key=lambda p: datetime.strptime(p.lastUpdated, "%Y-%m-%d %H:%M:%S"), key=lambda p: datetime.strptime(p.lastUpdated, "%Y-%m-%d %H:%M:%S"),

View File

@ -1,7 +1,6 @@
""" """
This library contains all the functions related to playlists. This library contains all the functions related to playlists.
""" """
import os import os
import random import random
import string import string

View File

@ -1,5 +1,6 @@
from dataclasses import dataclass from dataclasses import dataclass
from datetime import datetime from datetime import datetime
from app import models from app import models
@ -61,7 +62,9 @@ class Playlist:
description: str description: str
count: int = 0 count: int = 0
def __init__(self, p: models.Playlist, construct_last_updated: bool = True) -> None: def __init__(self,
p: models.Playlist,
construct_last_updated: bool = True) -> None:
self.playlistid = p.playlistid self.playlistid = p.playlistid
self.name = p.name self.name = p.name
self.image = p.image self.image = p.image

View File

@ -8,7 +8,9 @@
- [ ] Compress thumbnails - [ ] Compress thumbnails
# Features + # Features +
## Needed features ## Needed features
- [ ] Adding songs to queue - [ ] Adding songs to queue
<!-- --> <!-- -->
- [ ] Add keyboard shortcuts - [ ] Add keyboard shortcuts
@ -19,6 +21,7 @@
- [ ] Playing song radio - [ ] Playing song radio
## Future features ## Future features
- [ ] Toggle shuffle - [ ] Toggle shuffle
- [ ] Toggle repeat - [ ] Toggle repeat
- [ ] Suggest similar artists - [ ] Suggest similar artists

View File

@ -22,4 +22,4 @@ export enum ContextSrc {
PHeader = "PHeader", PHeader = "PHeader",
Track = "Track", Track = "Track",
AHeader = "AHeader", AHeader = "AHeader",
} }

View File

@ -150,7 +150,7 @@ function formatSeconds(seconds) {
} }
} }
export function getCurrentDate(){ export function getCurrentDate() {
const date = new Date(); const date = new Date();
const yyyy = date.getFullYear(); const yyyy = date.getFullYear();
@ -169,5 +169,5 @@ export default {
focusCurrent, focusCurrent,
formatSeconds, formatSeconds,
getElem, getElem,
getCurrentDate getCurrentDate,
}; };