diff --git a/app/__pycache__/app.cpython-312.pyc b/app/__pycache__/app.cpython-312.pyc index d3af949..564fb9f 100644 Binary files a/app/__pycache__/app.cpython-312.pyc and b/app/__pycache__/app.cpython-312.pyc differ diff --git a/app/logs/app.log b/app/logs/app.log index 35f612d..67c3790 100644 --- a/app/logs/app.log +++ b/app/logs/app.log @@ -317,3 +317,132 @@ 2025-05-12 10:12:45,395 - INFO - 127.0.0.1 - - [12/May/2025 10:12:45] "GET /static/resurse/VID-20250502-WA0066.mp4 HTTP/1.1" 206 - 2025-05-12 10:13:33,661 - INFO - 127.0.0.1 - - [12/May/2025 10:13:33] "GET /static/app_config.json HTTP/1.1" 304 - 2025-05-12 10:13:33,663 - INFO - 127.0.0.1 - - [12/May/2025 10:13:33] "GET /static/resurse/IMG_20250503_220547.jpg HTTP/1.1" 200 - +2025-05-12 10:13:48,679 - INFO - 127.0.0.1 - - [12/May/2025 10:13:48] "GET /static/app_config.json HTTP/1.1" 304 - +2025-05-12 10:13:48,985 - INFO - 127.0.0.1 - - [12/May/2025 10:13:48] "GET /static/resurse/IMG_20250506_080609.jpg HTTP/1.1" 200 - +2025-05-12 10:14:04,019 - INFO - 127.0.0.1 - - [12/May/2025 10:14:04] "GET /static/resurse/VID-20250502-WA0066.mp4 HTTP/1.1" 206 - +2025-05-12 10:14:16,488 - INFO - 127.0.0.1 - - [12/May/2025 10:14:16] "GET /updated_playlist.json HTTP/1.1" 200 - +2025-05-12 10:14:42,710 - INFO - 127.0.0.1 - - [12/May/2025 10:14:42] "GET /static/resurse/VID-20250502-WA0066.mp4 HTTP/1.1" 206 - +2025-05-12 10:14:42,962 - INFO - 127.0.0.1 - - [12/May/2025 10:14:42] "GET /static/resurse/VID-20250502-WA0066.mp4 HTTP/1.1" 206 - +2025-05-12 10:15:00,410 - INFO - 127.0.0.1 - - [12/May/2025 10:15:00] "GET /static/resurse/VID-20250502-WA0066.mp4 HTTP/1.1" 206 - +2025-05-12 10:15:48,570 - INFO - 127.0.0.1 - - [12/May/2025 10:15:48] "GET /static/resurse/VID_20250502_113903.mp4 HTTP/1.1" 206 - +2025-05-12 10:15:48,817 - INFO - 127.0.0.1 - - [12/May/2025 10:15:48] "GET /static/resurse/VID_20250502_113903.mp4 HTTP/1.1" 206 - +2025-05-12 10:15:48,892 - INFO - 127.0.0.1 - - [12/May/2025 10:15:48] "GET /static/resurse/VID_20250502_113903.mp4 HTTP/1.1" 206 - +2025-05-12 10:15:49,158 - INFO - 127.0.0.1 - - [12/May/2025 10:15:49] "GET /static/resurse/VID_20250502_113903.mp4 HTTP/1.1" 206 - +2025-05-12 10:15:49,209 - INFO - 127.0.0.1 - - [12/May/2025 10:15:49] "GET /static/resurse/VID_20250502_113903.mp4 HTTP/1.1" 206 - +2025-05-12 10:16:15,333 - INFO - 127.0.0.1 - - [12/May/2025 10:16:15] "GET /static/app_config.json HTTP/1.1" 304 - +2025-05-12 10:16:15,660 - INFO - 127.0.0.1 - - [12/May/2025 10:16:15] "GET /static/resurse/IMG_20250503_220547.jpg HTTP/1.1" 304 - +2025-05-12 10:16:30,666 - INFO - 127.0.0.1 - - [12/May/2025 10:16:30] "GET /static/app_config.json HTTP/1.1" 304 - +2025-05-12 10:16:30,670 - INFO - 127.0.0.1 - - [12/May/2025 10:16:30] "GET /static/resurse/IMG_20250506_080609.jpg HTTP/1.1" 304 - +2025-05-12 10:16:45,702 - INFO - 127.0.0.1 - - [12/May/2025 10:16:45] "GET /static/resurse/VID-20250502-WA0066.mp4 HTTP/1.1" 206 - +2025-05-12 10:17:03,332 - INFO - Checking for playlist updates... +2025-05-12 10:17:03,332 - INFO - Starting playlist file download using app configuration... +2025-05-12 10:17:03,899 - INFO - Server playlist retrieved successfully. +2025-05-12 10:17:03,899 - INFO - No changes detected in the server playlist. Skipping download. +2025-05-12 10:17:03,900 - INFO - Creating updated playlist with local file paths... +2025-05-12 10:17:03,900 - INFO - Updated playlist saved to ./updated_playlist.json +2025-05-12 10:17:03,900 - INFO - Playlist check complete. +2025-05-12 10:17:41,231 - INFO - 127.0.0.1 - - [12/May/2025 10:17:41] "GET /static/resurse/VID-20250502-WA0066.mp4 HTTP/1.1" 206 - +2025-05-12 10:17:41,485 - INFO - 127.0.0.1 - - [12/May/2025 10:17:41] "GET /static/resurse/VID-20250502-WA0066.mp4 HTTP/1.1" 206 - +2025-05-12 10:18:29,991 - INFO - 127.0.0.1 - - [12/May/2025 10:18:29] "GET /static/resurse/VID_20250502_113903.mp4 HTTP/1.1" 206 - +2025-05-12 10:18:30,322 - INFO - 127.0.0.1 - - [12/May/2025 10:18:30] "GET /static/resurse/VID_20250502_113903.mp4 HTTP/1.1" 206 - +2025-05-12 10:18:30,574 - INFO - 127.0.0.1 - - [12/May/2025 10:18:30] "GET /static/resurse/VID_20250502_113903.mp4 HTTP/1.1" 206 - +2025-05-12 10:18:30,635 - INFO - 127.0.0.1 - - [12/May/2025 10:18:30] "GET /static/resurse/VID_20250502_113903.mp4 HTTP/1.1" 206 - +2025-05-12 10:18:30,898 - INFO - 127.0.0.1 - - [12/May/2025 10:18:30] "GET /static/resurse/VID_20250502_113903.mp4 HTTP/1.1" 206 - +2025-05-12 10:18:57,059 - INFO - 127.0.0.1 - - [12/May/2025 10:18:57] "GET /static/app_config.json HTTP/1.1" 304 - +2025-05-12 10:18:57,370 - INFO - 127.0.0.1 - - [12/May/2025 10:18:57] "GET /static/resurse/IMG_20250503_220547.jpg HTTP/1.1" 304 - +2025-05-12 10:19:12,429 - INFO - 127.0.0.1 - - [12/May/2025 10:19:12] "GET /static/app_config.json HTTP/1.1" 304 - +2025-05-12 10:19:12,430 - INFO - 127.0.0.1 - - [12/May/2025 10:19:12] "GET /static/resurse/IMG_20250506_080609.jpg HTTP/1.1" 304 - +2025-05-12 10:19:16,471 - INFO - 127.0.0.1 - - [12/May/2025 10:19:16] "GET /updated_playlist.json HTTP/1.1" 200 - +2025-05-12 10:19:27,995 - INFO - 127.0.0.1 - - [12/May/2025 10:19:27] "GET /static/resurse/VID-20250502-WA0066.mp4 HTTP/1.1" 206 - +2025-05-12 10:20:23,190 - INFO - 127.0.0.1 - - [12/May/2025 10:20:23] "GET /static/resurse/VID-20250502-WA0066.mp4 HTTP/1.1" 206 - +2025-05-12 10:20:23,512 - INFO - 127.0.0.1 - - [12/May/2025 10:20:23] "GET /static/resurse/VID-20250502-WA0066.mp4 HTTP/1.1" 206 - +2025-05-12 10:20:43,446 - INFO - Initializing playlist... +2025-05-12 10:20:43,446 - INFO - Starting playlist file download using app configuration... +2025-05-12 10:20:44,012 - INFO - Server playlist retrieved successfully. +2025-05-12 10:20:44,013 - INFO - No changes detected in the server playlist. Skipping download. +2025-05-12 10:20:44,013 - INFO - Creating updated playlist with local file paths... +2025-05-12 10:20:44,014 - INFO - Updated playlist saved to ./updated_playlist.json +2025-05-12 10:20:44,014 - INFO - Playlist initialization complete. +2025-05-12 10:20:44,014 - INFO - Creating updated playlist with local file paths... +2025-05-12 10:20:44,015 - INFO - Updated playlist saved to ./updated_playlist.json +2025-05-12 10:20:44,016 - INFO - Checking for playlist updates... +2025-05-12 10:20:44,016 - INFO - Starting playlist file download using app configuration... +2025-05-12 10:20:44,023 - INFO - WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. + * Running on all addresses (0.0.0.0) + * Running on http://127.0.0.1:1025 + * Running on http://172.29.169.189:1025 +2025-05-12 10:20:44,024 - INFO - Press CTRL+C to quit +2025-05-12 10:20:44,598 - INFO - Server playlist retrieved successfully. +2025-05-12 10:20:44,599 - INFO - No changes detected in the server playlist. Skipping download. +2025-05-12 10:20:44,600 - INFO - Creating updated playlist with local file paths... +2025-05-12 10:20:44,602 - INFO - Updated playlist saved to ./updated_playlist.json +2025-05-12 10:20:44,602 - INFO - Checking for old log files to delete... +2025-05-12 10:20:44,603 - INFO - Checking for unused media files to delete... +2025-05-12 10:20:44,611 - INFO - Deleted unused media file: ./static/resurse/VID_20250501_184228.mp4 +2025-05-12 10:20:44,612 - INFO - Playlist check complete. +2025-05-12 10:20:54,041 - INFO - 127.0.0.1 - - [12/May/2025 10:20:54] "GET / HTTP/1.1" 200 - +2025-05-12 10:20:54,713 - INFO - 127.0.0.1 - - [12/May/2025 10:20:54] "GET /favicon.ico HTTP/1.1" 404 - +2025-05-12 10:20:54,731 - INFO - 127.0.0.1 - - [12/May/2025 10:20:54] "GET /static/app_config.json HTTP/1.1" 304 - +2025-05-12 10:20:54,971 - INFO - 127.0.0.1 - - [12/May/2025 10:20:54] "GET /favicon.ico HTTP/1.1" 404 - +2025-05-12 10:20:55,038 - INFO - 127.0.0.1 - - [12/May/2025 10:20:55] "GET /updated_playlist.json HTTP/1.1" 200 - +2025-05-12 10:20:55,072 - INFO - 127.0.0.1 - - [12/May/2025 10:20:55] "GET /static/resurse/IMG_20250503_220547.jpg HTTP/1.1" 304 - +2025-05-12 10:21:10,368 - INFO - 127.0.0.1 - - [12/May/2025 10:21:10] "GET /static/resurse/IMG_20250506_080609.jpg HTTP/1.1" 304 - +2025-05-12 10:22:48,862 - INFO - 127.0.0.1 - - [12/May/2025 10:22:48] "GET /static/resurse/VID-20250502-WA0066.mp4 HTTP/1.1" 206 - +2025-05-12 10:22:57,472 - INFO - 127.0.0.1 - - [12/May/2025 10:22:57] "GET /static/resurse/VID-20250502-WA0066.mp4 HTTP/1.1" 206 - +2025-05-12 10:22:57,781 - INFO - 127.0.0.1 - - [12/May/2025 10:22:57] "GET /favicon.ico HTTP/1.1" 404 - +2025-05-12 10:22:57,839 - INFO - 127.0.0.1 - - [12/May/2025 10:22:57] "GET /static/resurse/VID-20250502-WA0066.mp4 HTTP/1.1" 206 - +2025-05-12 10:31:50,295 - INFO - Initializing playlist... +2025-05-12 10:31:50,296 - INFO - Starting playlist file download using app configuration... +2025-05-12 10:31:50,879 - INFO - Server playlist retrieved successfully. +2025-05-12 10:31:50,880 - INFO - Changes detected in the server playlist. Downloading updated files... +2025-05-12 10:31:50,880 - INFO - Downloading file: IMG_20250503_220547.jpg +2025-05-12 10:31:51,201 - INFO - Downloaded IMG_20250503_220547.jpg to ./static/resurse/IMG_20250503_220547.jpg +2025-05-12 10:31:51,202 - INFO - Downloading file: IMG_20250506_080609.jpg +2025-05-12 10:31:51,503 - INFO - Downloaded IMG_20250506_080609.jpg to ./static/resurse/IMG_20250506_080609.jpg +2025-05-12 10:31:51,503 - INFO - Downloading file: VID-20250502-WA0066.mp4 +2025-05-12 10:31:53,365 - INFO - Downloaded VID-20250502-WA0066.mp4 to ./static/resurse/VID-20250502-WA0066.mp4 +2025-05-12 10:31:53,366 - INFO - Downloading file: VID_20250502_113903.mp4 +2025-05-12 10:31:56,666 - INFO - Downloaded VID_20250502_113903.mp4 to ./static/resurse/VID_20250502_113903.mp4 +2025-05-12 10:31:56,672 - INFO - Downloading file: VID-20250503-WA0036.mp4 +2025-05-12 10:32:42,591 - ERROR - Failed to connect to server: ('Connection broken: IncompleteRead(45455616 bytes read, 21695405 more expected)', IncompleteRead(45455616 bytes read, 21695405 more expected)) +2025-05-12 10:32:42,591 - INFO - Creating updated playlist with local file paths... +2025-05-12 10:32:42,595 - INFO - Updated playlist saved to ./updated_playlist.json +2025-05-12 10:32:42,595 - INFO - Playlist initialization complete. +2025-05-12 10:32:42,595 - INFO - Creating updated playlist with local file paths... +2025-05-12 10:32:42,596 - INFO - Updated playlist saved to ./updated_playlist.json +2025-05-12 10:32:42,597 - INFO - Checking for playlist updates... +2025-05-12 10:32:42,598 - INFO - Starting playlist file download using app configuration... +2025-05-12 10:32:42,605 - INFO - WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. + * Running on all addresses (0.0.0.0) + * Running on http://127.0.0.1:1025 + * Running on http://172.29.169.189:1025 +2025-05-12 10:32:42,606 - INFO - Press CTRL+C to quit +2025-05-12 10:32:43,168 - INFO - Server playlist retrieved successfully. +2025-05-12 10:32:43,169 - INFO - Changes detected in the server playlist. Downloading updated files... +2025-05-12 10:32:43,169 - INFO - Downloading file: IMG_20250503_220547.jpg +2025-05-12 10:32:43,500 - INFO - Downloaded IMG_20250503_220547.jpg to ./static/resurse/IMG_20250503_220547.jpg +2025-05-12 10:32:43,501 - INFO - Downloading file: IMG_20250506_080609.jpg +2025-05-12 10:32:43,809 - INFO - Downloaded IMG_20250506_080609.jpg to ./static/resurse/IMG_20250506_080609.jpg +2025-05-12 10:32:43,809 - INFO - Downloading file: VID-20250502-WA0066.mp4 +2025-05-12 10:32:45,941 - INFO - Downloaded VID-20250502-WA0066.mp4 to ./static/resurse/VID-20250502-WA0066.mp4 +2025-05-12 10:32:45,941 - INFO - Downloading file: VID_20250502_113903.mp4 +2025-05-12 10:32:49,840 - INFO - Downloaded VID_20250502_113903.mp4 to ./static/resurse/VID_20250502_113903.mp4 +2025-05-12 10:32:49,840 - INFO - Downloading file: VID-20250503-WA0036.mp4 +2025-05-12 10:32:53,772 - INFO - Downloaded VID-20250503-WA0036.mp4 to ./static/resurse/VID-20250503-WA0036.mp4 +2025-05-12 10:32:53,814 - INFO - Creating updated playlist with local file paths... +2025-05-12 10:32:53,815 - INFO - Updated playlist saved to ./updated_playlist.json +2025-05-12 10:32:53,815 - INFO - Creating updated playlist with local file paths... +2025-05-12 10:32:53,835 - INFO - Updated playlist saved to ./updated_playlist.json +2025-05-12 10:32:53,836 - INFO - Checking for old log files to delete... +2025-05-12 10:32:53,836 - INFO - Checking for unused media files to delete... +2025-05-12 10:32:53,836 - INFO - Playlist check complete. +2025-05-12 10:32:59,001 - INFO - 127.0.0.1 - - [12/May/2025 10:32:59] "GET / HTTP/1.1" 304 - +2025-05-12 10:32:59,666 - INFO - 127.0.0.1 - - [12/May/2025 10:32:59] "GET /static/app_config.json HTTP/1.1" 304 - +2025-05-12 10:32:59,667 - INFO - 127.0.0.1 - - [12/May/2025 10:32:59] "GET /favicon.ico HTTP/1.1" 404 - +2025-05-12 10:32:59,927 - INFO - 127.0.0.1 - - [12/May/2025 10:32:59] "GET /updated_playlist.json HTTP/1.1" 200 - +2025-05-12 10:32:59,985 - INFO - 127.0.0.1 - - [12/May/2025 10:32:59] "GET /static/resurse/IMG_20250503_220547.jpg HTTP/1.1" 200 - +2025-05-12 10:33:10,649 - INFO - 127.0.0.1 - - [12/May/2025 10:33:10] "GET / HTTP/1.1" 304 - +2025-05-12 10:33:10,917 - INFO - 127.0.0.1 - - [12/May/2025 10:33:10] "GET /static/app_config.json HTTP/1.1" 304 - +2025-05-12 10:33:11,068 - INFO - 127.0.0.1 - - [12/May/2025 10:33:11] "GET /favicon.ico HTTP/1.1" 404 - +2025-05-12 10:33:11,075 - INFO - 127.0.0.1 - - [12/May/2025 10:33:11] "GET /updated_playlist.json HTTP/1.1" 304 - +2025-05-12 10:33:11,244 - INFO - 127.0.0.1 - - [12/May/2025 10:33:11] "GET /static/resurse/IMG_20250503_220547.jpg HTTP/1.1" 304 - diff --git a/app/run_app.sh b/app/run_app.sh index f4abc04..fc7f5d1 100644 --- a/app/run_app.sh +++ b/app/run_app.sh @@ -8,10 +8,10 @@ source venv/bin/activate # Run the Gunicorn server in the foreground echo "Starting Gunicorn server..." -exec python3 run_gunicorn.py & +exec python3 app.py & # Wait for 5 seconds to ensure the server is up -sleep 5 +sleep 8 # Launch Chromium in fullscreen and kiosk mode echo "Launching Chromium in fullscreen and kiosk mode..." diff --git a/app/static/resurse/playlist.json b/app/static/resurse/playlist.json index 48b56dc..da7a41b 100755 --- a/app/static/resurse/playlist.json +++ b/app/static/resurse/playlist.json @@ -1 +1 @@ -[{"duration": 15, "file_name": "IMG_20250503_220547.jpg", "url": "http://digi-signage.moto-adv.com/media/IMG_20250503_220547.jpg"}, {"duration": 15, "file_name": "IMG_20250506_080609.jpg", "url": "http://digi-signage.moto-adv.com/media/IMG_20250506_080609.jpg"}, {"duration": 103, "file_name": "VID-20250502-WA0066.mp4", "url": "http://digi-signage.moto-adv.com/media/VID-20250502-WA0066.mp4"}, {"duration": 26, "file_name": "VID_20250502_113903.mp4", "url": "http://digi-signage.moto-adv.com/media/VID_20250502_113903.mp4"}] \ No newline at end of file +[{"duration": 15, "file_name": "IMG_20250503_220547.jpg", "url": "http://digi-signage.moto-adv.com/media/IMG_20250503_220547.jpg"}, {"duration": 15, "file_name": "IMG_20250506_080609.jpg", "url": "http://digi-signage.moto-adv.com/media/IMG_20250506_080609.jpg"}, {"duration": 103, "file_name": "VID-20250502-WA0066.mp4", "url": "http://digi-signage.moto-adv.com/media/VID-20250502-WA0066.mp4"}, {"duration": 26, "file_name": "VID_20250502_113903.mp4", "url": "http://digi-signage.moto-adv.com/media/VID_20250502_113903.mp4"}, {"duration": 200, "file_name": "VID-20250503-WA0036.mp4", "url": "http://digi-signage.moto-adv.com/media/VID-20250503-WA0036.mp4"}] \ No newline at end of file diff --git a/app/updated_playlist.json b/app/updated_playlist.json index 1194032..6b097d0 100755 --- a/app/updated_playlist.json +++ b/app/updated_playlist.json @@ -18,5 +18,10 @@ "type": "video", "url": "/static/resurse/VID_20250502_113903.mp4", "duration": 26 + }, + { + "type": "video", + "url": "/static/resurse/VID-20250503-WA0036.mp4", + "duration": 200 } ] \ No newline at end of file