mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-07-30 11:38:30 -07:00
Move common libs to libs/common
This commit is contained in:
parent
8dbb1a2451
commit
1f4bd41bcc
1612 changed files with 962 additions and 10 deletions
|
@ -1,22 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
JSON Utils
|
||||
"""
|
||||
import json
|
||||
|
||||
from six import text_type
|
||||
from rebulk.match import Match
|
||||
|
||||
class GuessitEncoder(json.JSONEncoder):
|
||||
"""
|
||||
JSON Encoder for guessit response
|
||||
"""
|
||||
|
||||
def default(self, o): # pylint:disable=method-hidden
|
||||
if isinstance(o, Match):
|
||||
return o.advanced
|
||||
if hasattr(o, 'name'): # Babelfish languages/countries long name
|
||||
return text_type(o.name)
|
||||
# pragma: no cover
|
||||
return text_type(o)
|
Loading…
Add table
Add a link
Reference in a new issue