mirror of
https://github.com/fHDHR/fHDHR_NextPVR.git
synced 2025-12-06 07:56:57 -05:00
Create Client IDs for Tuners
This commit is contained in:
parent
c61df94ae4
commit
cc8e8a8715
@ -53,12 +53,19 @@ class Tuner():
|
||||
return stream.get()
|
||||
|
||||
def set_status(self, stream_args):
|
||||
self.status = {
|
||||
"status": "Active",
|
||||
"method": stream_args["method"],
|
||||
"accessed": stream_args["accessed"],
|
||||
"channel": stream_args["channel"],
|
||||
"proxied_url": stream_args["channelUri"],
|
||||
"time_start": datetime.datetime.utcnow(),
|
||||
"downloaded": 0
|
||||
}
|
||||
if self.status["status"] != "Active":
|
||||
self.status = {
|
||||
"status": "Active",
|
||||
"clients": [],
|
||||
"clients_id": [],
|
||||
"method": stream_args["method"],
|
||||
"accessed": [stream_args["accessed"]],
|
||||
"channel": stream_args["channel"],
|
||||
"proxied_url": stream_args["channelUri"],
|
||||
"time_start": datetime.datetime.utcnow(),
|
||||
"downloaded": 0
|
||||
}
|
||||
if stream_args["client"] not in self.status["clients"]:
|
||||
self.status["clients"].append(stream_args["client"])
|
||||
if stream_args["client_id"] not in self.status["clients_id"]:
|
||||
self.status["clients_id"].append(stream_args["client_id"])
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
from flask import Response, request, redirect, abort, stream_with_context
|
||||
import urllib.parse
|
||||
import uuid
|
||||
|
||||
from fHDHR.exceptions import TunerError
|
||||
|
||||
@ -63,7 +64,8 @@ class Watch():
|
||||
"duration": duration,
|
||||
"transcode": transcode,
|
||||
"accessed": accessed_url,
|
||||
"client": client_address
|
||||
"client": client_address,
|
||||
"client_id": str(client_address) + "_" + str(uuid.uuid4())
|
||||
}
|
||||
|
||||
try:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user