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 . .
|
COPY . .
|
||||||
|
|
||||||
EXPOSE 5000
|
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
|
# flask --app src.app run --host=0.0.0.0 --port=5001 --debug
|
||||||
|
|
|
@ -5,3 +5,4 @@ dotenv
|
||||||
requests
|
requests
|
||||||
qrcode
|
qrcode
|
||||||
Pillow
|
Pillow
|
||||||
|
eventlet>=0.33
|
||||||
|
|
|
@ -287,4 +287,4 @@ def get_audio_url():
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
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
|
import random
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
|
|
||||||
from .song import Song
|
from song import Song
|
||||||
|
|
||||||
USER_SCORE_WEIGHT = 0.7
|
USER_SCORE_WEIGHT = 0.7
|
||||||
ARTIST_WEIGHT = 0.1
|
ARTIST_WEIGHT = 0.1
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from sqlite3 import Cursor
|
from sqlite3 import Cursor
|
||||||
|
|
||||||
from .connect import get_connection
|
from connect import get_connection
|
||||||
|
|
||||||
|
|
||||||
def init_db(db: Cursor):
|
def init_db(db: Cursor):
|
||||||
|
|
|
@ -4,7 +4,7 @@ from sqlite3 import Cursor
|
||||||
from flask import Flask
|
from flask import Flask
|
||||||
from flask_socketio import SocketIO
|
from flask_socketio import SocketIO
|
||||||
|
|
||||||
from .room import Room
|
from room import Room
|
||||||
|
|
||||||
|
|
||||||
@dataclass
|
@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`}
|
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}
|
{#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}
|
{/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" />
|
<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>
|
</div>
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import type { Suggestion } from "$lib/types"
|
import type { Suggestion } from "$lib/types"
|
||||||
|
import { ThumbsUp, ThumbsDown } from "@lucide/svelte"
|
||||||
|
|
||||||
let { suggestions = $bindable(), roomId }: { suggestions: Suggestion[]; roomId: string } = $props()
|
let { suggestions = $bindable(), roomId }: { suggestions: Suggestion[]; roomId: string } = $props()
|
||||||
|
|
||||||
|
@ -16,26 +17,26 @@
|
||||||
|
|
||||||
{#each suggestions as sug, idx}
|
{#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 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" />
|
<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">
|
<div class="text-white flex-col w-fit h-fit">
|
||||||
<p>{sug.title}</p>
|
<b>{sug.title}</b>
|
||||||
<p>{sug.artist}</p>
|
<p>{sug.artist}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex w-1/4 flex-row items-center justify-center gap-2">
|
<div class="flex w-1/4 flex-row items-center justify-center gap-2">
|
||||||
<button
|
<button
|
||||||
class="grayscale"
|
class="text-green-500"
|
||||||
onclick={() => {
|
onclick={() => {
|
||||||
vote(idx, 1, sug.uuid)
|
vote(idx, 1, sug.uuid)
|
||||||
}}>👍</button
|
}}><ThumbsUp /></button
|
||||||
>
|
>
|
||||||
<p class="font-semibold text-white">{sug.upvote}</p>
|
<p class="font-semibold text-white">{sug.upvote}</p>
|
||||||
<button
|
<button
|
||||||
class="duration-100 hover:scale-150"
|
class="duration-100 hover:scale-150 text-red-500"
|
||||||
onclick={() => {
|
onclick={() => {
|
||||||
vote(idx, -1, sug.uuid)
|
vote(idx, -1, sug.uuid)
|
||||||
}}><div class="rotate-180">👍</div></button
|
}}><ThumbsDown /></button
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -4,6 +4,6 @@
|
||||||
let { children } = $props()
|
let { children } = $props()
|
||||||
</script>
|
</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()}
|
{@render children()}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -69,7 +69,7 @@
|
||||||
{#if returnError}
|
{#if returnError}
|
||||||
<Error {returnError} />
|
<Error {returnError} />
|
||||||
{:else}
|
{: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} />
|
<QueueSlider {queueSongs} {playingIndex} />
|
||||||
<div class="w-full py-6 lg:w-[30vw]">
|
<div class="w-full py-6 lg:w-[30vw]">
|
||||||
<SuggestionInput roomId={data.roomId} />
|
<SuggestionInput roomId={data.roomId} />
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue