mirror of https://gitlab.com/bashrc2/epicyon
Tidying
parent
bdee44e6b8
commit
f7b9fcead8
24
daemon.py
24
daemon.py
|
@ -228,6 +228,18 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
def _pathIsVideo(self) -> bool:
|
||||||
|
if self.path.endswith('.ogv') or \
|
||||||
|
self.path.endswith('.mp4'):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
|
def _pathIsAudio(self) -> bool:
|
||||||
|
if self.path.endswith('.ogg') or \
|
||||||
|
self.path.endswith('.mp3'):
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def handle_error(self, request, client_address):
|
def handle_error(self, request, client_address):
|
||||||
print('ERROR: http server error: ' + str(request) + ', ' +
|
print('ERROR: http server error: ' + str(request) + ', ' +
|
||||||
str(client_address))
|
str(client_address))
|
||||||
|
@ -1868,10 +1880,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
# Note that this comes before the busy flag to avoid conflicts
|
# Note that this comes before the busy flag to avoid conflicts
|
||||||
if '/media/' in self.path:
|
if '/media/' in self.path:
|
||||||
if self._pathIsImage() or \
|
if self._pathIsImage() or \
|
||||||
self.path.endswith('.mp4') or \
|
self._pathIsVideo() or \
|
||||||
self.path.endswith('.ogv') or \
|
self._pathIsAudio():
|
||||||
self.path.endswith('.mp3') or \
|
|
||||||
self.path.endswith('.ogg'):
|
|
||||||
mediaStr = self.path.split('/media/')[1]
|
mediaStr = self.path.split('/media/')[1]
|
||||||
mediaFilename = \
|
mediaFilename = \
|
||||||
self.server.baseDir + '/media/' + mediaStr
|
self.server.baseDir + '/media/' + mediaStr
|
||||||
|
@ -4920,10 +4930,8 @@ class PubServer(BaseHTTPRequestHandler):
|
||||||
|
|
||||||
if '/media/' in self.path:
|
if '/media/' in self.path:
|
||||||
if self._pathIsImage() or \
|
if self._pathIsImage() or \
|
||||||
self.path.endswith('.mp4') or \
|
self._pathIsVideo() or \
|
||||||
self.path.endswith('.ogv') or \
|
self._pathIsAudio():
|
||||||
self.path.endswith('.mp3') or \
|
|
||||||
self.path.endswith('.ogg'):
|
|
||||||
mediaStr = self.path.split('/media/')[1]
|
mediaStr = self.path.split('/media/')[1]
|
||||||
mediaFilename = \
|
mediaFilename = \
|
||||||
self.server.baseDir + '/media/' + mediaStr
|
self.server.baseDir + '/media/' + mediaStr
|
||||||
|
|
Loading…
Reference in New Issue