Merge branch 'main' of https://repos.hackathon.bz.it/2025-summer/team-1
This commit is contained in:
commit
d337f747f3
10 changed files with 19 additions and 16 deletions
|
@ -12,5 +12,6 @@ RUN pip install --no-cache-dir -r requirements.txt
|
|||
COPY . .
|
||||
|
||||
EXPOSE 5000
|
||||
CMD ["flask", "--app", "src.app", "run", "--debug", "--host=0.0.0.0"]
|
||||
# CMD ["flask", "--app", "src.app", "run", "--debug", "--host=0.0.0.0"]
|
||||
CMD ["python3", "src/app.py"]
|
||||
# flask --app src.app run --host=0.0.0.0 --port=5001 --debug
|
||||
|
|
|
@ -4,4 +4,5 @@ flask-socketio
|
|||
dotenv
|
||||
requests
|
||||
qrcode
|
||||
Pillow
|
||||
Pillow
|
||||
eventlet>=0.33
|
||||
|
|
|
@ -287,4 +287,4 @@ def get_audio_url():
|
|||
|
||||
|
||||
if __name__ == "__main__":
|
||||
socketio.run(app, debug=True)
|
||||
socketio.run(app, host="0.0.0.0", port=5000, debug=True)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import random
|
||||
from dataclasses import dataclass
|
||||
|
||||
from .song import Song
|
||||
from song import Song
|
||||
|
||||
USER_SCORE_WEIGHT = 0.7
|
||||
ARTIST_WEIGHT = 0.1
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from dataclasses import dataclass
|
||||
from sqlite3 import Cursor
|
||||
|
||||
from .connect import get_connection
|
||||
from connect import get_connection
|
||||
|
||||
|
||||
def init_db(db: Cursor):
|
||||
|
|
|
@ -4,7 +4,7 @@ from sqlite3 import Cursor
|
|||
from flask import Flask
|
||||
from flask_socketio import SocketIO
|
||||
|
||||
from .room import Room
|
||||
from room import Room
|
||||
|
||||
|
||||
@dataclass
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
class={`flex h-[60vw] max-h-[250px] w-[60vw] max-w-[250px] items-center justify-center ${i === 1 ? "spin-slower rounded-full border-2 border-black" : "rounded"} object-cover`}
|
||||
>
|
||||
{#if i === 1}
|
||||
<div class="absolute z-20 h-16 w-16 rounded-full border-2 border-black bg-white"></div>
|
||||
<div class="absolute z-20 h-16 w-16 rounded-full border-2 border-black bg-light-pine-base dark:bg-dark-pine-base"></div>
|
||||
{/if}
|
||||
<img class={`h-full overflow-hidden ${i === 1 ? "rounded-full" : "rounded"}`} src={`https://lastfm.freetls.fastly.net/i/u/174s/${song.image_id}.png`} alt="Song cover" />
|
||||
</div>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<script lang="ts">
|
||||
import type { Suggestion } from "$lib/types"
|
||||
import { ThumbsUp, ThumbsDown } from "@lucide/svelte"
|
||||
|
||||
let { suggestions = $bindable(), roomId }: { suggestions: Suggestion[]; roomId: string } = $props()
|
||||
|
||||
|
@ -16,26 +17,26 @@
|
|||
|
||||
{#each suggestions as sug, idx}
|
||||
<div class="flex h-[80px] w-full flex-row gap-2 rounded border-2 border-indigo-600 bg-indigo-500 p-2 shadow-md duration-100 hover:bg-indigo-400">
|
||||
<div class="flex w-3/4 flex-row gap-2">
|
||||
<div class="flex w-3/4 flex-row gap-2 items-center">
|
||||
<img class="w-[60px] min-w-[60px] rounded" src={`https://lastfm.freetls.fastly.net/i/u/174s/${sug.image_id}.png`} alt="Song cover" />
|
||||
<div class="text-white">
|
||||
<p>{sug.title}</p>
|
||||
<div class="text-white flex-col w-fit h-fit">
|
||||
<b>{sug.title}</b>
|
||||
<p>{sug.artist}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex w-1/4 flex-row items-center justify-center gap-2">
|
||||
<button
|
||||
class="grayscale"
|
||||
class="text-green-500"
|
||||
onclick={() => {
|
||||
vote(idx, 1, sug.uuid)
|
||||
}}>👍</button
|
||||
}}><ThumbsUp /></button
|
||||
>
|
||||
<p class="font-semibold text-white">{sug.upvote}</p>
|
||||
<button
|
||||
class="duration-100 hover:scale-150"
|
||||
class="duration-100 hover:scale-150 text-red-500"
|
||||
onclick={() => {
|
||||
vote(idx, -1, sug.uuid)
|
||||
}}><div class="rotate-180">👍</div></button
|
||||
}}><ThumbsDown /></button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -4,6 +4,6 @@
|
|||
let { children } = $props()
|
||||
</script>
|
||||
|
||||
<div class="min-h-screen w-full bg-light-pine-base px-6 text-light-pine-text sm:px-20 md:px-40 lg:px-80 dark:bg-dark-pine-base dark:text-dark-pine-text">
|
||||
<div class="min-h-screen w-full bg-light-pine-base px-1 text-light-pine-text sm:px-20 md:px-40 lg:px-80 dark:bg-dark-pine-base dark:text-dark-pine-text">
|
||||
{@render children()}
|
||||
</div>
|
||||
|
|
|
@ -69,7 +69,7 @@
|
|||
{#if returnError}
|
||||
<Error {returnError} />
|
||||
{:else}
|
||||
<div class="flex w-full flex-col items-center justify-center p-4 lg:p-10">
|
||||
<div class="flex w-full flex-col items-center justify-center py-4 px-2 lg:p-10">
|
||||
<QueueSlider {queueSongs} {playingIndex} />
|
||||
<div class="w-full py-6 lg:w-[30vw]">
|
||||
<SuggestionInput roomId={data.roomId} />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue