Skip to content

Commit 54f75d6

Browse files
authored
Merge pull request #2920 from adafruit/nfc_media
update username variable for nfc media player
2 parents 77e01f0 + 10b39d0 commit 54f75d6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Raspberry_Pi_NFC_Movie_Player/nfc_movie_player.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
from adafruit_pn532.spi import PN532_SPI
1515

1616
# ---- Update these file paths for your raspberry pi! ----
17-
home_path = "/home/YOUR-USERNAME"
18-
image_path = f"{home_path}/Pictures/blinka.png"
19-
movie_path = f"{home_path}/Videos"
17+
username = "YOUR-USERNAME"
18+
image_path = f"/home/{username}/Pictures/blinka.png"
19+
movie_path = f"/media/{username}/YOUR-M.2-DRIVE-NAME"
2020
csv_file = "movies.csv"
2121
# ----
2222

@@ -79,7 +79,7 @@ def move():
7979
root.after(30, move)
8080

8181
def get_movie(uid):
82-
with open(f"{home_path}/{csv_file}", "r") as file:
82+
with open(f"/home/{username}/{csv_file}", "r") as file:
8383
reader = csv.DictReader(file)
8484
for row in reader:
8585
if row["uid"] == uid:
@@ -96,7 +96,7 @@ def read_card():
9696
movie_name = get_movie(title)
9797
if movie_path:
9898
video = f"{movie_path}/{movie_name}.mp4"
99-
subprocess.run(["sudo", "-u", "adafruit", "vlc", "--fullscreen", video], check=False)
99+
subprocess.run(["sudo", "-u", username, "vlc", "--fullscreen", video], check=False)
100100
now_playing = True
101101
else:
102102
current_time = datetime.now().strftime("%I:%M %p")

0 commit comments

Comments
 (0)