Skip to content

Commit

Permalink
feat: more improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfromyeg committed Dec 29, 2023
1 parent 58c4a6f commit 027d7b7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 13 deletions.
12 changes: 2 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,19 +1,11 @@
### Custom

# New data directories
exports/

content/**/**
!content/.gitkeep

bereal/static/videos/**
!bereal/static/videos/.gitkeep

# Data directories the original project
combined/
primary/
secondary/
song.wav
exports/**/**
!exports/.gitkeep

### React.gitignore

Expand Down
5 changes: 2 additions & 3 deletions bereal/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,18 +122,17 @@ def create_video() -> tuple[Response, int]:
year = request.form["year"]
sdate, edate = year2dates(year)

wav_file = request.files["file"]
wav_file = request.files.get("file", None)

mode_str = request.form.get("mode")
mode = str2mode(mode_str)

logger.debug("Downloading music file %s...", wav_file.filename)

song_folder = os.path.join(CONTENT_PATH, phone, year)
os.makedirs(song_folder, exist_ok=True)
song_path = os.path.join(song_folder, "song.wav")

if wav_file:
logger.debug("Downloading music file %s...", wav_file.filename)
try:
wav_file.save(song_path)
except Exception as error:
Expand Down
Binary file modified bereal/static/images/endCard.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file added exports/.gitkeep
Empty file.

0 comments on commit 027d7b7

Please sign in to comment.