mirror of
https://github.com/morpheus65535/bazarr
synced 2024-12-26 01:27:07 +00:00
18 lines
351 B
Python
18 lines
351 B
Python
|
import jsonpickle
|
||
|
|
||
|
|
||
|
class Serializer(object):
|
||
|
@classmethod
|
||
|
def encode(cls, value):
|
||
|
return jsonpickle.encode(value)
|
||
|
|
||
|
@classmethod
|
||
|
def decode(cls, value, client=None):
|
||
|
try:
|
||
|
result = jsonpickle.decode(value)
|
||
|
result.client = client
|
||
|
|
||
|
return result
|
||
|
except:
|
||
|
return None
|