Skip to content

Commit

Permalink
Merge branch 'master' into save4prefs
Browse files Browse the repository at this point in the history
  • Loading branch information
elig0n authored Jul 22, 2021
2 parents 044126e + 23a674f commit aa8af6d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion MpvRemote/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:supportsRtl="false"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
Expand Down
5 changes: 4 additions & 1 deletion server/mpv_remote_app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ def parse_args():
parser.add_argument("-p", "--port", metavar="PORT_NUMBER", type=int,
default=28899,
help="Port number on which to listen (default: 28899)")
parser.add_argument("-a", "--address", metavar="ADDRESS", type=str,
default="0.0.0.0",
help="Address to bind to")
parser.add_argument("-s", "--mpv-socket", metavar="SOCK", type=str,
default=None,
help="Unix socket that mpv is listening on (default: auto detect)")
Expand Down Expand Up @@ -98,7 +101,7 @@ def main():
"--input-ipc-server="+args.mpv_socket, "--idle"])

logging.debug(f"using mpv socket {args.mpv_socket}")
ms = MediaServer(args.port, args.password, root=args.root,
ms = MediaServer(args.port, args.address, args.password, root=args.root,
no_hidden=not args.hidden, filetypes=args.filetypes,
controller=MpvController(args.mpv_socket))
ms.run(daemon=args.daemon)
Expand Down
5 changes: 3 additions & 2 deletions server/mpv_remote_app/media_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
from os.path import abspath, realpath, join, isdir, isfile

class MediaServer:
def __init__(self, port, password, root=os.getcwd(), no_hidden=True, filetypes=None, controller=None):
def __init__(self, port, address, password, root=os.getcwd(), no_hidden=True, filetypes=None, controller=None):
self.port = port # port to listen on
self.address = address # address to bind to
self.password = password # server secret
self.root = abspath(realpath(root)) # top level directory of server
self.no_hidden = no_hidden # send / play hidden files
Expand All @@ -37,7 +38,7 @@ def open(self):
logging.debug("opening server")
# create socket
self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
self.sock.bind(('0.0.0.0', self.port))
self.sock.bind((self.address, self.port))
return self
# runs the server
def run(self, daemon=False):
Expand Down

0 comments on commit aa8af6d

Please sign in to comment.