Skip to content

Commit

Permalink
First Version
Browse files Browse the repository at this point in the history
  • Loading branch information
danielkorkin committed May 18, 2024
1 parent 45e6ea8 commit 833187e
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 10 deletions.
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
SPOTIPY_CLIENT_ID=
SPOTIPY_CLIENT_SECRET=
SPOTIPY_REDIRECT_URI=
SECRET_KEY=
SECRET_KEY=
ACCOUNT_KEY_PATH=
2 changes: 1 addition & 1 deletion app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def sync():
lyrics_response = requests.get(f'https://api.lyrics.ovh/v1/{current_track["item"]["artists"][0]["name"]}/{song_name}')
if lyrics_response.status_code == 200:
raw_lyrics = lyrics_response.json().get('lyrics', '').split('\n')
lyrics = sanitize_lyrics(raw_lyrics)
lyrics = ["\n"] + sanitize_lyrics(raw_lyrics)
else:
lyrics = ["Lyrics not found"]

Expand Down
3 changes: 2 additions & 1 deletion app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ class Config:
SPOTIPY_CLIENT_SECRET = os.getenv('SPOTIPY_CLIENT_SECRET')
SPOTIPY_REDIRECT_URI = os.getenv('SPOTIPY_REDIRECT_URI', 'http://localhost:5000/callback')
SECRET_KEY = os.getenv('SECRET_KEY', 'your_secret_key')
ACCOUNT_KEY_PATH = os.getenv('ACCOUNT_KEY_PATCH', "serviceAccountKey.json")

cred = credentials.Certificate("serviceAccountKey.json")
cred = credentials.Certificate(Config.ACCOUNT_KEY_PATH)
firebase_admin.initialize_app(cred)
db = firestore.client()
6 changes: 5 additions & 1 deletion app/static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,15 @@ p {

button, .button {
font-size: 16px;
padding: 10px;
margin-right: 10px;
cursor: pointer;
background-color: #1db954;
color: white;
border: none;
border-radius: 5px;
text-decoration: none;
border-radius: 30px;
padding: 10px 24px;
}

a {
Expand All @@ -45,6 +46,9 @@ a {

button:hover, .button:hover {
background-color: #1ed760;
-webkit-box-shadow:0px 0px 31px 3px rgba(29,185,84,1);
-moz-box-shadow: 0px 0px 31px 3px rgba(29,185,84,1);
box-shadow: 0px 0px 31px 3px rgba(29,185,84,1);
}

.center {
Expand Down
1 change: 1 addition & 0 deletions app/templates/no-sync.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<body>
<div class="center">
<h1>No Song Currently Playing</h1>
<button onclick="window.location.reload();">Retry</button>
</div>
</body>
</html>
14 changes: 8 additions & 6 deletions app/templates/sync.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@
<script src="https://sdk.scdn.co/spotify-player.js"></script>
</head>
<body>
<h1>Sync Lyrics for {{ song_name }} by {{ artists }}</h1>
<div id="lyricsContainer">
<div id="currentLine"></div>
<div id="nextLine"></div>
<div class="center">
<h1>Sync Lyrics for {{ song_name }} by {{ artists }}</h1>
<div id="lyricsContainer">
<div id="currentLine"></div>
<div id="nextLine"></div>
</div>
<button id="startButton">Start Sync</button>
<button id="saveButton" onclick="saveLyrics()">Save Lyrics</button>
</div>
<button id="startButton">Start Sync</button>
<button id="saveButton" onclick="saveLyrics()">Save Lyrics</button>

<script>
const lyricsArray = [];
Expand Down

0 comments on commit 833187e

Please sign in to comment.