Removes the vlc://quit call from the playlist
This ensures that subsequent calls to the play utility always goes through, even if something else is already playing. One issue is that subsequent calls to this program while an existing instance is running will cause the second program to simply cancel while the first continues with its new playlist. This can make process monitoring difficult.
This commit is contained in:
27
play
27
play
@@ -1,26 +1,9 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
'''
|
|
||||||
Copyright (C) 2021 Markil 3
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
'''
|
|
||||||
|
|
||||||
import pathlib
|
import pathlib
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from urllib import parse
|
from urllib import parse
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import os
|
||||||
import sys
|
import sys
|
||||||
import random
|
import random
|
||||||
from os.path import exists
|
from os.path import exists
|
||||||
@@ -278,13 +261,13 @@ m3u, playlist Normally, playlists are ignored during the file search.
|
|||||||
vlcArgs = ["cvlc"]
|
vlcArgs = ["cvlc"]
|
||||||
if "l" in options:
|
if "l" in options:
|
||||||
vlcArgs.append("--loop")
|
vlcArgs.append("--loop")
|
||||||
else:
|
#else:
|
||||||
files.append("vlc://quit")
|
#files.append("vlc://quit")
|
||||||
vlcArgs += files
|
vlcArgs += files
|
||||||
#print(" ".join(vlcArgs))
|
#print(" ".join(vlcArgs))
|
||||||
print("Launching VLC: %s" % (vlcArgs))
|
print("Launching VLC: %s" % (vlcArgs))
|
||||||
process = subprocess.Popen(vlcArgs, stdout=sys.stdout, stderr=sys.stderr)
|
|
||||||
if not "l" in options:
|
if not "l" in options:
|
||||||
exit(process.wait())
|
os.execvp(vlcArgs[0], vlcArgs)
|
||||||
else:
|
else:
|
||||||
|
subprocess.Popen(vlcArgs, stdout=sys.stdout, stderr=sys.stderr)
|
||||||
exit(0)
|
exit(0)
|
||||||
|
|||||||
Reference in New Issue
Block a user