From 328a9f97592a5c1593d6e9c7807962c5adbae53e Mon Sep 17 00:00:00 2001 From: Liz Date: Mon, 4 Nov 2024 09:36:29 -0500 Subject: [PATCH 1/3] update username variable for nfc media player --- Raspberry_Pi_NFC_Movie_Player/nfc_movie_player.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Raspberry_Pi_NFC_Movie_Player/nfc_movie_player.py b/Raspberry_Pi_NFC_Movie_Player/nfc_movie_player.py index d2352aad2..3bfefc8bc 100644 --- a/Raspberry_Pi_NFC_Movie_Player/nfc_movie_player.py +++ b/Raspberry_Pi_NFC_Movie_Player/nfc_movie_player.py @@ -14,9 +14,9 @@ from adafruit_pn532.spi import PN532_SPI # ---- Update these file paths for your raspberry pi! ---- -home_path = "/home/YOUR-USERNAME" -image_path = f"{home_path}/Pictures/blinka.png" -movie_path = f"{home_path}/Videos" +username = "YOUR-USERNAME" +image_path = f"/home/{username}/Pictures/blinka.png" +movie_path = f"/media/{username}/YOUR-M.2-DRIVE-NAME" csv_file = "movies.csv" # ---- From bbee0bec106e0c8f9e3248c1263e69cbd7ce83a6 Mon Sep 17 00:00:00 2001 From: Liz Date: Mon, 4 Nov 2024 09:40:45 -0500 Subject: [PATCH 2/3] Update nfc_movie_player.py --- Raspberry_Pi_NFC_Movie_Player/nfc_movie_player.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Raspberry_Pi_NFC_Movie_Player/nfc_movie_player.py b/Raspberry_Pi_NFC_Movie_Player/nfc_movie_player.py index 3bfefc8bc..196b0cba9 100644 --- a/Raspberry_Pi_NFC_Movie_Player/nfc_movie_player.py +++ b/Raspberry_Pi_NFC_Movie_Player/nfc_movie_player.py @@ -79,7 +79,7 @@ def move(): root.after(30, move) def get_movie(uid): - with open(f"{home_path}/{csv_file}", "r") as file: + with open(f"/home/{username}/{csv_file}", "r") as file: reader = csv.DictReader(file) for row in reader: if row["uid"] == uid: From 10b39d0ae897608703bd733f6c37453f274d8ee2 Mon Sep 17 00:00:00 2001 From: Liz Date: Mon, 4 Nov 2024 09:41:33 -0500 Subject: [PATCH 3/3] Update nfc_movie_player.py --- Raspberry_Pi_NFC_Movie_Player/nfc_movie_player.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Raspberry_Pi_NFC_Movie_Player/nfc_movie_player.py b/Raspberry_Pi_NFC_Movie_Player/nfc_movie_player.py index 196b0cba9..1857b3192 100644 --- a/Raspberry_Pi_NFC_Movie_Player/nfc_movie_player.py +++ b/Raspberry_Pi_NFC_Movie_Player/nfc_movie_player.py @@ -96,7 +96,7 @@ def read_card(): movie_name = get_movie(title) if movie_path: video = f"{movie_path}/{movie_name}.mp4" - subprocess.run(["sudo", "-u", "adafruit", "vlc", "--fullscreen", video], check=False) + subprocess.run(["sudo", "-u", username, "vlc", "--fullscreen", video], check=False) now_playing = True else: current_time = datetime.now().strftime("%I:%M %p")