mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-08-22 22:23:36 -07:00
setting + get_date_formats extension
This commit is contained in:
parent
f329f960cb
commit
f7c2034a4a
2 changed files with 9 additions and 4 deletions
|
@ -420,8 +420,7 @@ def clean_filename(filename, replace='_'):
|
||||||
return cleaned_filename
|
return cleaned_filename
|
||||||
|
|
||||||
def format_date_based_show(date):
|
def format_date_based_show(date):
|
||||||
# logger.info(plexpy.CONFIG.DATE_BASED_TV_SHOW_FORMAT)
|
return str(arrow.get(date).format(html.unescape(plexpy.CONFIG.DATE_BASED_TV_SHOW_FORMAT)))
|
||||||
return str(date).replace('-', html.unescape('·'))
|
|
||||||
|
|
||||||
def split_strip(s, delimiter=','):
|
def split_strip(s, delimiter=','):
|
||||||
return [x.strip() for x in str(s).split(delimiter) if x.strip()]
|
return [x.strip() for x in str(s).split(delimiter) if x.strip()]
|
||||||
|
|
|
@ -27,6 +27,7 @@ import json
|
||||||
import ssl as _ssl
|
import ssl as _ssl
|
||||||
import linecache
|
import linecache
|
||||||
import os
|
import os
|
||||||
|
import html
|
||||||
import shutil
|
import shutil
|
||||||
import sys
|
import sys
|
||||||
import threading
|
import threading
|
||||||
|
@ -307,7 +308,7 @@ class WebInterface(object):
|
||||||
json:
|
json:
|
||||||
{"date_format": "YYYY-MM-DD",
|
{"date_format": "YYYY-MM-DD",
|
||||||
"time_format": "HH:mm",
|
"time_format": "HH:mm",
|
||||||
}
|
"date_based_tv_show_format": "YYYY·MM·DD"}
|
||||||
```
|
```
|
||||||
"""
|
"""
|
||||||
if plexpy.CONFIG.DATE_FORMAT:
|
if plexpy.CONFIG.DATE_FORMAT:
|
||||||
|
@ -318,9 +319,14 @@ class WebInterface(object):
|
||||||
time_format = plexpy.CONFIG.TIME_FORMAT
|
time_format = plexpy.CONFIG.TIME_FORMAT
|
||||||
else:
|
else:
|
||||||
time_format = 'HH:mm'
|
time_format = 'HH:mm'
|
||||||
|
if plexpy.CONFIG.DATE_BASED_TV_SHOW_FORMAT:
|
||||||
|
date_based_tv_show_format = html.unescape(plexpy.CONFIG.DATE_BASED_TV_SHOW_FORMAT)
|
||||||
|
else:
|
||||||
|
date_based_tv_show_format = html.unescape('YYYY·MM·DD')
|
||||||
|
|
||||||
formats = {'date_format': date_format,
|
formats = {'date_format': date_format,
|
||||||
'time_format': time_format}
|
'time_format': time_format,
|
||||||
|
'date_based_tv_show_format': date_based_tv_show_format}
|
||||||
|
|
||||||
return formats
|
return formats
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue