From d0825fda7155b7d14506abf048d993618194b6cf Mon Sep 17 00:00:00 2001 From: Chris Fulljames Date: Sun, 18 Jan 2026 14:11:40 -0500 Subject: [PATCH] Add dreams importer UI --- src/littlesongplace/__init__.py | 5 +- src/littlesongplace/dreams_importer.py | 15 ++++ .../templates/dreams-importer.html | 62 +++++++++++++ src/littlesongplace/templates/edit-song.html | 87 +++++++++++++------ 4 files changed, 141 insertions(+), 28 deletions(-) create mode 100644 src/littlesongplace/dreams_importer.py create mode 100644 src/littlesongplace/templates/dreams-importer.html diff --git a/src/littlesongplace/__init__.py b/src/littlesongplace/__init__.py index e07807c..abd9426 100644 --- a/src/littlesongplace/__init__.py +++ b/src/littlesongplace/__init__.py @@ -11,8 +11,8 @@ from flask import Flask, render_template, request, redirect, g, session, abort, send_from_directory, flash, get_flashed_messages from werkzeug.middleware.proxy_fix import ProxyFix -from . import activity, auth, colors, comments, datadir, db, jams, playlists, \ - profiles, push_notifications, songs, users +from . import activity, auth, colors, comments, datadir, db, dreams_importer, \ + jams, playlists, profiles, push_notifications, songs, users from .logutils import flash_and_log # Logging @@ -32,6 +32,7 @@ app.config["MAX_CONTENT_LENGTH"] = 1 * 1024 * 1024 * 1024 app.register_blueprint(activity.bp) app.register_blueprint(auth.bp) app.register_blueprint(comments.bp) +app.register_blueprint(dreams_importer.bp) app.register_blueprint(jams.bp) app.register_blueprint(playlists.bp) app.register_blueprint(profiles.bp) diff --git a/src/littlesongplace/dreams_importer.py b/src/littlesongplace/dreams_importer.py new file mode 100644 index 0000000..fcd07cc --- /dev/null +++ b/src/littlesongplace/dreams_importer.py @@ -0,0 +1,15 @@ +from datetime import datetime, timezone + +from flask import abort, Blueprint, get_flashed_messages, session, redirect, \ + render_template, request + +from . import db +from .logutils import flash_and_log + +bp = Blueprint("dreams-importer", __name__, url_prefix="/dreams-importer") + +@bp.get("") +@bp.get("/") +def dreams_importer(): + return render_template("dreams-importer.html") + diff --git a/src/littlesongplace/templates/dreams-importer.html b/src/littlesongplace/templates/dreams-importer.html new file mode 100644 index 0000000..374e5e0 --- /dev/null +++ b/src/littlesongplace/templates/dreams-importer.html @@ -0,0 +1,62 @@ +{% extends "base.html" %} +{% block title %}Dreams Importer{% endblock %} +{% block body %} + +

dreams importer

+ +

how it works

+

+The Dreams importer is a script that runs on my PC. It automates interactions +with littlesong.place, indreams.me, and Dreams running on my PS5. +

+

+This means that my PC and PS5 need to be turned on and connected for the +importer to work. Generally, I will try to make sure it runs at least once a +week (usually on weekends) when there are songs in the import queue. I will +also make sure to run it the day of the little song jam to upload any jam +entries. +

+

+If more than one weekend has passed and it still hasn't run, please send me an +email at +littlesongplace@gmail.com. +

+

+The script performs the following sequence for each song in the queue: +

    +
  1. Connect to LSP and get the song's InDreams URL
  2. +
  3. Load the InDreams URL and click the "Play Later" button
  4. +
  5. Remix the element in Dreams
  6. +
  7. Play the song without recording to make sure all samples are loaded
  8. +
  9. Play the song again, recording the audio
  10. +
  11. Upload the song to LSP
  12. +
+

+

+ +(For the audio nerds: The audio is recorded through a pair of high-quality USB +audio interfaces, one connected to the PS5 and one to my PC. Both interfaces +operate at 24 bits/48 kHz. The audio signal gets converted from digital to +analog and back again, so there will be some inherent losses in this process. +But in general it should be better than the lossy compressed audio you get from +most HDMI capture cards or a screen recording.) + +

+ +

tips for imports

+For best results: + + +{% endblock %} diff --git a/src/littlesongplace/templates/edit-song.html b/src/littlesongplace/templates/edit-song.html index d360ef8..2495139 100644 --- a/src/littlesongplace/templates/edit-song.html +++ b/src/littlesongplace/templates/edit-song.html @@ -4,35 +4,49 @@ {% block body %} -

-Handy Tip: -If you upload a video (e.g. a PS4/PS5 capture file), the audio will be extracted automatically! -Most standard audio/video formats are supported - .wav, .mp3, .ogg, .mp4, etc. -

+

{% if song %}Edit Song{% else %}Upload a New Song{% endif %}

{% if song %}
-

Edit Song

{% else %} -

Upload a New Song

{% endif %} +
- -
+ +
- - + +
-
+
+ + +
+ + +

- +
+ + Handy Tip: + If you upload a video (e.g. a PS4/PS5 capture file), the audio will be extracted automatically! + Most standard audio/video formats are supported - .wav, .mp3, .ogg, .mp4, etc. +
-