Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3
FROM python:3.9

WORKDIR /app

Expand Down
4 changes: 3 additions & 1 deletion dlna/dlna_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,9 @@ async def get_data(self):
self.info = info
if self.info:
self.name = self.info['device']['friendlyName']
self.model = self.info['device'].get('modelDescription', settings.product)
self.model = settings.product
if "modelDescription" in self.info['device'] and self.info['device']['modelDescription'] != None and self.info['device']['modelDescription'].strip() != "":
self.model = self.info['device']['modelDescription']
self.uuid = self.info['device']['UDN'][len("uuid:"):]
for service in self.info['device']['serviceList']['service']:
self.services[service['serviceType']] = DlnaDeviceService(service, self)
Expand Down
8 changes: 8 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: "3.9"
services:
plexdlnaplayer:
build: .
network_mode: "host"
restart: unless-stopped
volumes:
- "./config:/config"
8 changes: 7 additions & 1 deletion plex/plexserver.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

import traceback
from fastapi import FastAPI, Request, Header, Query, HTTPException, Form
from fastapi.responses import Response
import uvicorn
Expand Down Expand Up @@ -34,7 +35,12 @@ async def on_new_dlna_device(location_url):
device = DlnaDevice(location_url)
try:
await device.get_data()
except Exception:
except Exception as e:
# Here seems to be a good place for an Exception optimization. Maybe some kind of filtering or debug logging?
# @ToDo for another time
# If someone would like to debug his fault just uncomment this line
# traceback.print_exc()
print(e)
return
print(f"got new dlna device from {device.name}")
asyncio.create_task(device.loop_subscribe(), name=f"dlna sub {device.name}")
Expand Down