feat: add better handling
All checks were successful
Cross-Compile Binaries / compile-linux (push) Successful in 4m6s
Cross-Compile Binaries / compile-windows (push) Successful in 9m27s

This commit is contained in:
2026-02-09 14:35:24 +01:00
parent 52b46a6f2e
commit 8ba479e45a
3 changed files with 16 additions and 7 deletions

View File

@@ -119,12 +119,13 @@ case "\$3" in
if [[ "\$2" == "presentation" ]]; then
echo "Finding and moving media..."
media_file=\$(find /opt/raspscreen/media \( -name "*.pptx" -o -name "*.odp" \))
media_file=\$(find /opt/raspscreen/media -path /opt/raspscreen/media/current -prune -o \( -name "*.pptx" -o -name "*.odp" \) -type f -print)
echo "New media file: \$media_file"
old_file=\$(find /opt/raspscreen/media/current \( -name "*.pptx" -o -name "*.odp" \))
echo "Old file: \$old_file"
cp -v "\$media_file" /opt/raspscreen/media/current
echo "Copying new media into staging area..."
cp "\$media_file" /opt/raspscreen/media/current
current_media=\$(find /opt/raspscreen/media/current \( -name "*.pptx" -o -name "*.odp" \))
echo "Prepared media: \$current_media"
@@ -143,7 +144,8 @@ case "\$3" in
old_file=\$(find /opt/raspscreen/media/current \( -name "*.mp4" -o -name "*.mkv" -o -name "*.mov" -o -name "*.webm" \))
echo "Old file: \$old_file"
cp -v "\$media_file" /opt/raspscreen/media/current
echo "Copying new media into staging area..."
cp "\$media_file" /opt/raspscreen/media/current
current_media=\$(find /opt/raspscreen/media/current \( -name "*.mp4" -o -name "*.mkv" -o -name "*.mov" -o -name "*.webm" \))
echo "Prepared media: \$current_media"

View File

@@ -50,12 +50,13 @@ case "$3" in
if [[ "$2" == "presentation" ]]; then
echo "Finding and moving media..."
media_file=$(find /opt/raspscreen/media \( -name "*.pptx" -o -name "*.odp" \))
media_file=$(find /opt/raspscreen/media -path /opt/raspscreen/media/current -prune -o \( -name "*.pptx" -o -name "*.odp" \) -type f -print)
echo "New media file: $media_file"
old_file=$(find /opt/raspscreen/media/current \( -name "*.pptx" -o -name "*.odp" \))
echo "Old file: $old_file"
cp -v "$media_file" /opt/raspscreen/media/current
echo "Copying new media into staging area..."
cp "$media_file" /opt/raspscreen/media/current
current_media=$(find /opt/raspscreen/media/current \( -name "*.pptx" -o -name "*.odp" \))
echo "Prepared media: $current_media"
@@ -74,7 +75,8 @@ case "$3" in
old_file=$(find /opt/raspscreen/media/current \( -name "*.mp4" -o -name "*.mkv" -o -name "*.mov" -o -name "*.webm" \))
echo "Old file: $old_file"
cp -v "$media_file" /opt/raspscreen/media/current
echo "Copying new media into staging area..."
cp "$media_file" /opt/raspscreen/media/current
current_media=$(find /opt/raspscreen/media/current \( -name "*.mp4" -o -name "*.mkv" -o -name "*.mov" -o -name "*.webm" \))
echo "Prepared media: $current_media"

View File

@@ -137,6 +137,8 @@ func drawTargetSection(raspiNames []string, raspiTarget *string, uploadBtn, relo
previousTarget = selected
*raspiTarget = selected
uploadBtn.Disable()
reloadBtn.Disable()
refreshButtons(verifyBtn, uploadBtn, reloadBtn)
})
@@ -246,8 +248,11 @@ func drawFooter(app fyne.App, raspiTarget, localUploadPath *string, targetMode *
// Configuration of the bottom of the application
var uploadBtn *widget.Button
var reloadBtn *widget.Button
uploadBtn = widget.NewButton("Upload File", func() {
uploadBtn.Importance = widget.HighImportance
reloadBtn.Disable()
refreshButtons(uploadBtn)
go func() {
@@ -255,6 +260,7 @@ func drawFooter(app fyne.App, raspiTarget, localUploadPath *string, targetMode *
if ok {
flashColor(uploadBtn, FlashSuccess)
reloadBtn.Enable()
} else {
flashColor(uploadBtn, FlashError)
}
@@ -265,7 +271,6 @@ func drawFooter(app fyne.App, raspiTarget, localUploadPath *string, targetMode *
uploadBtn,
)
var reloadBtn *widget.Button
reloadBtn = widget.NewButton("Restart Program", func() {
reloadBtn.Importance = widget.HighImportance
refreshButtons(uploadBtn)