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()
|
return stream.get()
|
||||||
|
|
||||||
def set_status(self, stream_args):
|
def set_status(self, stream_args):
|
||||||
self.status = {
|
if self.status["status"] != "Active":
|
||||||
"status": "Active",
|
self.status = {
|
||||||
"method": stream_args["method"],
|
"status": "Active",
|
||||||
"accessed": stream_args["accessed"],
|
"clients": [],
|
||||||
"channel": stream_args["channel"],
|
"clients_id": [],
|
||||||
"proxied_url": stream_args["channelUri"],
|
"method": stream_args["method"],
|
||||||
"time_start": datetime.datetime.utcnow(),
|
"accessed": [stream_args["accessed"]],
|
||||||
"downloaded": 0
|
"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
|
from flask import Response, request, redirect, abort, stream_with_context
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
|
import uuid
|
||||||
|
|
||||||
from fHDHR.exceptions import TunerError
|
from fHDHR.exceptions import TunerError
|
||||||
|
|
||||||
@ -63,7 +64,8 @@ class Watch():
|
|||||||
"duration": duration,
|
"duration": duration,
|
||||||
"transcode": transcode,
|
"transcode": transcode,
|
||||||
"accessed": accessed_url,
|
"accessed": accessed_url,
|
||||||
"client": client_address
|
"client": client_address,
|
||||||
|
"client_id": str(client_address) + "_" + str(uuid.uuid4())
|
||||||
}
|
}
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user