You've already forked RadioPlayer
mirror of
https://github.com/radio95-rnt/RadioPlayer.git
synced 2026-02-27 06:03:52 +01:00
this
This commit is contained in:
@@ -146,6 +146,15 @@ def play_playlist(playlist_path, play_newest_first=False):
|
|||||||
update_rds(track_name)
|
update_rds(track_name)
|
||||||
|
|
||||||
subprocess.run(['ffplay', '-nodisp', '-stats', '-hide_banner', '-autoexit', track_path])
|
subprocess.run(['ffplay', '-nodisp', '-stats', '-hide_banner', '-autoexit', track_path])
|
||||||
|
if can_delete_file("/tmp/radioPlayer_quit"):
|
||||||
|
os.remove("/tmp/radioPlayer_quit")
|
||||||
|
exit()
|
||||||
|
|
||||||
|
def can_delete_file(filepath):
|
||||||
|
if not os.path.isfile(filepath):
|
||||||
|
return False
|
||||||
|
directory = os.path.dirname(os.path.abspath(filepath)) or '.'
|
||||||
|
return os.access(directory, os.W_OK | os.X_OK)
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
arg = sys.argv[1] if len(sys.argv) > 1 else None
|
arg = sys.argv[1] if len(sys.argv) > 1 else None
|
||||||
@@ -167,6 +176,9 @@ def main():
|
|||||||
print(f"Now playing: {track_name}")
|
print(f"Now playing: {track_name}")
|
||||||
update_rds(track_name)
|
update_rds(track_name)
|
||||||
subprocess.run(['ffplay', '-nodisp', '-stats', '-hide_banner', '-autoexit', pre_track_path])
|
subprocess.run(['ffplay', '-nodisp', '-stats', '-hide_banner', '-autoexit', pre_track_path])
|
||||||
|
if can_delete_file("/tmp/radioPlayer_quit"):
|
||||||
|
os.remove("/tmp/radioPlayer_quit")
|
||||||
|
exit()
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
current_hour = get_current_hour()
|
current_hour = get_current_hour()
|
||||||
|
|||||||
Reference in New Issue
Block a user