Skip to content

Commit

Permalink
Merge pull request #59 from blastbeng/dev
Browse files Browse the repository at this point in the history
First Dashboard Implementation
  • Loading branch information
blastbeng authored Sep 26, 2024
2 parents b1fc5a3 + 83f2d20 commit e65c3fa
Show file tree
Hide file tree
Showing 42 changed files with 3,419 additions and 1,569 deletions.
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ ENV PATH="$HOME/.local/bin:$PATH"
WORKDIR $HOME/spotisub
ENV PATH="/home/uwsgi/.local/bin:${PATH}"

COPY main.py init.py entrypoint.sh first_run.sh uwsgi.ini requirements.txt ./
COPY spotisub spotisub/
COPY templates templates/
COPY requirements.txt ./
RUN pip3 install --no-cache-dir -r requirements.txt
COPY main.py config.py init.py entrypoint.sh first_run.sh uwsgi.ini ./
COPY spotisub spotisub/

USER root
RUN chmod +x entrypoint.sh && \
chmod +x first_run.sh && \
chown -R user:user .

# CMD runs as root initially but switches to the user inside entrypoint.sh
ENTRYPOINT ["./entrypoint.sh"]
ENTRYPOINT ["./entrypoint.sh"]
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,8 @@ Same thing for artists top tracks playlists.
## Planned Features

Dashboard
* View which tracks are missing and decide to download trough spotdl or just ignore em
* View which tracks are being matched with the Spotify playlists\recommendations, and decide to keep or exclude em
* Configure some parameters of spotisub trough the dashboard instead of docker env variables
* Ability to delete, skip or download matching tracks from spotify
* Configure Spotisub trough the dashboard instead of docker env variables
* Ability to interact with spotdl and lidarr integrations from the dashboard

## Help
Expand All @@ -96,7 +95,9 @@ NOTE. Depending on your library size and your playlists number and size on Spoti
To avoid Spotify rate limiting a lot of time.sleep() have ben added to the code.


For any help contact me on Discord blastbong#9151
For any help join the Official Discord Server

https://discord.gg/jXQauuhy5w

## Authors

Expand Down
24 changes: 24 additions & 0 deletions config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import os
import random
import string

basedir = os.path.abspath(os.path.dirname(__file__))


class Config(object):
"""All application configurations"""

# Secret key
SECRET_KEY = ''.join(
random.choice(
string.ascii_lowercase +
string.digits) for _ in range(128))
SCHEDULER_API_ENABLED = True
SCHEDULER_API_PREFIX = "/api/v1/scheduler"

# Database configurations
SQLALCHEMY_DATABASE_NAME = 'spotisub.sqlite3'
SQLALCHEMY_DATABASE_PATH = 'sqlite:///' + os.path.join(basedir, 'cache')
SQLALCHEMY_DATABASE_URI = os.path.join(
SQLALCHEMY_DATABASE_PATH, SQLALCHEMY_DATABASE_NAME)
SQLALCHEMY_TRACK_MODIFICATIONS = False
2 changes: 1 addition & 1 deletion docker-compose.build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ services:
ports:
- 5183:5183
healthcheck:
test: curl -s http://127.0.0.1:5183/utils/healthcheck | grep -q 'Ok!' || exit 1
test: curl -s http://127.0.0.1:5183/api/v1/utils/healthcheck | grep -q 'Ok!' || exit 1
interval: 30s
retries: 20
start_period: 30s
2 changes: 1 addition & 1 deletion docker-compose.tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ services:
ports:
- 5183:5183
healthcheck:
test: curl -s http://127.0.0.1:5183/utils/healthcheck | grep -q 'Ok!' || exit 1
test: curl -s http://127.0.0.1:5183/api/v1/utils/healthcheck | grep -q 'Ok!' || exit 1
interval: 30s
retries: 20
start_period: 30s
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ services:
ports:
- 5183:5183
healthcheck:
test: curl -s http://127.0.0.1:5183/utils/healthcheck | grep -q 'Ok!' || exit 1
test: curl -s http://127.0.0.1:5183/api/v1/utils/healthcheck | grep -q 'Ok!' || exit 1
interval: 30s
retries: 20
start_period: 30s
7 changes: 3 additions & 4 deletions init.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@
from dotenv import load_dotenv
import spotipy
from spotipy import SpotifyOAuth
from spotisub.core.external.utils.constants import constants

dotenv_path = join(dirname(__file__), '.env')
load_dotenv(dotenv_path)

client_id = os.environ.get(constants.SPOTIPY_CLIENT_ID)
client_secret = os.environ.get(constants.SPOTIPY_CLIENT_SECRET)
redirect_uri = os.environ.get(constants.SPOTIPY_REDIRECT_URI)
client_id = os.environ.get("SPOTIPY_CLIENT_ID")
client_secret = os.environ.get("SPOTIPY_CLIENT_SECRET")
redirect_uri = os.environ.get("SPOTIPY_REDIRECT_URI")
SCOPE = "user-top-read,user-library-read,user-read-recently-played"

creds = SpotifyOAuth(
Expand Down
Loading

0 comments on commit e65c3fa

Please sign in to comment.