Merge pull request #16 from l3uddz/develop

Develop
pull/54/head
James 7 years ago committed by desimaniac
commit bdf032dc1c

@ -1,23 +1,42 @@
# Git
.git
# User-specific stuff:
.idea
# Systemd files
systemd
## File-based project format:
*.iws
# Logs
*.log*
# Configs
*.json
# IntelliJ
/out/
# Byte-compiled / optimized / DLL files
**/__pycache__
__pycache__/
*.py[cod]
*$py.class
*.pyc
# logs
*.log*
# databases
*.db
# configs
*.cfg
*.json
# generators
*.bat
# Pyenv
**/.python-version
# User-specific stuff:
.idea
# PyInstaller
build/
dist/
*.manifest
*.spec
# Git
.git
# Systemd
systemd

@ -1,22 +1,22 @@
FROM python:3.6-alpine3.7
# Arguments for build tracking
ARG BRANCH=
ARG COMMIT=
ENV \
# App directory
APP_DIR=traktarr \
# Branch to clone
BRANCH=master \
# Config file
BRANCH=${BRANCH} \
COMMIT=${COMMIT} \
TRAKTARR_CONFIG=/config/config.json \
# Log file
TRAKTARR_LOGFILE=/config/traktarr.log
COPY . /${APP_DIR}
RUN \
echo "** BRANCH: ${BRANCH} COMMIT: ${COMMIT} **" && \
echo "** Upgrade all packages **" && \
apk --no-cache -U upgrade && \
echo "** Install OS dependencies **" && \
apk --no-cache -U add git && \
echo "** Get Traktarr **" && \
git clone --depth 1 --branch ${BRANCH} https://github.com/l3uddz/traktarr.git /${APP_DIR} && \
echo "** Install PIP dependencies **" && \
pip install --no-cache-dir --upgrade pip setuptools && \
pip install --no-cache-dir --upgrade -r /${APP_DIR}/requirements.txt

@ -0,0 +1,6 @@
#!/bin/bash
# Docker cloud bug ?, working directory is not set acording to the config
cd ..
docker build --build-arg BRANCH=${SOURCE_BRANCH} --build-arg COMMIT=${SOURCE_COMMIT} -f ${DOCKERFILE_PATH} -t ${IMAGE_NAME} .

@ -493,21 +493,32 @@ def automatic_movies(add_delay=2.5, no_search=False, notifications=False):
def run(add_delay=2.5, no_search=False, no_notifications=False):
# add tasks to repeat
if cfg.automatic.movies.interval:
schedule.every(cfg.automatic.movies.interval).hours.do(automatic_movies, add_delay, no_search,
not no_notifications)
schedule.every(cfg.automatic.movies.interval).hours.do(
automatic_movies,
add_delay,
no_search,
not no_notifications
)
if cfg.automatic.shows.interval:
schedule.every(cfg.automatic.shows.interval).hours.do(automatic_shows, add_delay, no_search,
not no_notifications)
schedule.every(cfg.automatic.shows.interval).hours.do(
automatic_shows,
add_delay,
no_search,
not no_notifications
)
# run schedule
log.info("Automatic mode is now running...")
while True:
try:
# Sleep until next run
time.sleep(schedule.idle_seconds())
# Check jobs to run
schedule.run_pending()
except Exception:
log.exception("Unhandled exception occurred while processing scheduled tasks: ")
else:
time.sleep(1)
except Exception as e:
log.exception("Unhandled exception occurred while processing scheduled tasks: %s", e)
############################################################

Loading…
Cancel
Save