From 432467ec8d795e83772922fb7db185836410b928 Mon Sep 17 00:00:00 2001 From: bkfox Date: Fri, 2 Aug 2019 17:06:23 +0200 Subject: [PATCH] redesign streamer, make it sexy --- Manifest.in | 3 - __init__.py | 0 aircox/admin/__init__.py | 2 +- .../admin/__pycache__/__init__.cpython-37.pyc | Bin 1173 -> 1155 bytes aircox/controllers.py | 102 ++++++++++---- aircox/management/commands/archiver.py | 2 +- aircox/management/commands/diffusions.py | 2 +- aircox/management/commands/import_playlist.py | 2 +- aircox/management/commands/sounds_monitor.py | 2 +- .../commands/sounds_quality_check.py | 2 +- aircox/management/commands/streamer.py | 133 +++++++++++++----- .../models/__pycache__/episode.cpython-37.pyc | Bin 9960 -> 9958 bytes aircox/models/__pycache__/log.cpython-37.pyc | Bin 7749 -> 7752 bytes aircox/models/episode.py | 2 +- aircox/models/log.py | 33 ++--- aircox/templates/aircox/scripts/station.liq | 5 + aircox/utils.py | 14 +- setup.py | 6 +- 18 files changed, 210 insertions(+), 100 deletions(-) delete mode 100755 Manifest.in delete mode 100755 __init__.py diff --git a/Manifest.in b/Manifest.in deleted file mode 100755 index 1001e08..0000000 --- a/Manifest.in +++ /dev/null @@ -1,3 +0,0 @@ -include LICENSE -include README.md - diff --git a/__init__.py b/__init__.py deleted file mode 100755 index e69de29..0000000 diff --git a/aircox/admin/__init__.py b/aircox/admin/__init__.py index 1954e33..f7fcc8d 100644 --- a/aircox/admin/__init__.py +++ b/aircox/admin/__init__.py @@ -22,7 +22,7 @@ class StationAdmin(admin.ModelAdmin): @admin.register(Log) class LogAdmin(admin.ModelAdmin): - list_display = ['id', 'date', 'station', 'source', 'type', 'diffusion', 'sound', 'track'] + list_display = ['id', 'date', 'station', 'source', 'type', 'comment'] list_filter = ['date', 'source', 'station'] diff --git a/aircox/admin/__pycache__/__init__.cpython-37.pyc b/aircox/admin/__pycache__/__init__.cpython-37.pyc index 70c1708baad6ef144c63d5390c7644c333977b55..71693edc69a38292b94aee00307877da14e22fd8 100644 GIT binary patch delta 111 zcmbQr+04o7#LLUY00bT^F0nlud2chBvH^JxKwPW_BvKio7*iOcm{J&1m{OQiSW;M1 z*wWden1MW&6y|j1D3%oVUk>|z&eE_pOiL>*&dkrd#af(SnwN5mwWKI9 aIeT&-b0DM0$g3dCb&D-IF)ukar$}z{M0VlLKElz=jM0-1;tFD=q>KD#GKO9;`p4* z;u1~fA{CGrYe{86YH?A{=0~z=jNCaO&6Xe{cXF_Ns7eq>2}@pLZt5*oux3rhBCr}c zkQ#Xq5jy#dyt{5bhzXX72C*_ggaeSc#hO`?np<3C4rFVxfUPVlp6s9?0kH~fLgD6Q z1#TwBs>%6E{fsq}|0_u|)=rjIKE_rGG9`ZUb7eKghRJ*?ix?{=Z&XnaivbD8frum^ zaf_p%D8C@JsHCze86>6wB0vFH6a^yEK}0r)C;<_LAfggP)PRV35D^a|8aC^x?qUQ0 D@ONUd delta 346 zcmaFn`@)ykiI>+Sc(a#qG&5t=AR=dSpnRxGAdq>BB`+~I^%iScVoqtQCSws;jT}ggJctOHd`jM3AP>X@ z%S3@#>5~-|WEhJk+bKvu%mgbf*qo@q&BRzaIajHlv3l}fC27VQklmAYlsB`Lfb_*p zeyXg-SU;IZWf5cfdO b5yc>)07O)Ph-wf~2O{D?MEzzR)m@ALmh4xo diff --git a/aircox/models/__pycache__/log.cpython-37.pyc b/aircox/models/__pycache__/log.cpython-37.pyc index 893589bd41394899eb12b6ec470a07e2844f01fc..556d5da915371f59776b62836f6c8fee0f2d9514 100644 GIT binary patch delta 349 zcmX?VbHaw#iIZEF)ukaXYzVcLrzu}CKgr}HWtRoFGV{T z(*=`tRiyg5rNQ`R@&T!( zY(*eNm6Nlj)tUY?Or9bg4|L%dX%~+&p!hB3y!`Sa2@s3ZIU}*iEi*MIr3kE}1f&gQ z_brZK*N}L>P#>Qn3y>JtQcDnv6GWI#ZjezCCyf}-} zUB=^+7mHakCQrUACI=+{i1|k50F@Wzf{0`gkpd(#8JHLtZm}ol=jNv7m1wdQ6@g^X z6mkN^fKmw2e2^lr86X!GaZg?(p2YZWGpj@pBjcyd5t5FKjKz~@Nog?to_ttpDO({( zQN`puX>}$x#>vyAQV%R!3{nEJ=N3n>Ye>9bsE<#PIY begin seek(s, x) end) + server.register(namespace=id, + description="Get source's track remaining time", + usage="remaining", + "remaining", fun (_) -> begin json_of(source.remaining(s)) end) + s = store_metadata(id=id, size=1, s) add_skip_command(s) s diff --git a/aircox/utils.py b/aircox/utils.py index bc40228..34d2c4c 100755 --- a/aircox/utils.py +++ b/aircox/utils.py @@ -2,16 +2,18 @@ import datetime import django.utils.timezone as tz -def date_range(date): +def date_range(date, delta=None, **delta_kwargs): """ + Return a range of provided date such as `[date-delta, date+delta]`. + :param date: the reference date + :param delta: timedelta + :param \**delta_kwargs: timedelta init arguments + Return a datetime range for a given day, as: ```(date, 0:0:0:0; date, 23:59:59:999)```. """ - date = date_or_default(date, tz.datetime) - return ( - date.replace(hour=0, minute=0, second=0), - date.replace(hour=23, minute=59, second=59, microsecond=999) - ) + delta = tz.timedelta(**delta_kwargs) if delta is None else delta + return [date - delta, date + delta] def cast_date(date, into=datetime.date): diff --git a/setup.py b/setup.py index be65c0d..44b04aa 100755 --- a/setup.py +++ b/setup.py @@ -15,12 +15,12 @@ def to_array (path): setup( name='aircox', - version='0.1', + version='0.9', license='GPLv3', author='bkfox', - description='Aircox is a radio programs manager that includes tools and cms', + description='Aircox is a radio programs manager including tools and cms', long_description=to_rst('README.md'), - url='http://bkfox.net/', + url='https://github.com/bkfox/aircox', packages=find_packages(), include_package_data=True, install_requires=to_array('requirements.txt'),