aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rwxr-xr-xautomediabin124936 -> 124936 bytes
-rw-r--r--src/main.c7
-rwxr-xr-xtools/list-by-updated.sh (renamed from list-by-updated.sh)0
-rwxr-xr-xtools/list-missing-unwatched.py (renamed from list-missing-unwatched.py)0
-rwxr-xr-xtools/list-unwatched.py (renamed from list-unwatched.py)0
-rwxr-xr-xtools/open_media.py (renamed from open_media.py)0
-rwxr-xr-xtools/track.py (renamed from track.py)0
8 files changed, 5 insertions, 4 deletions
diff --git a/README.md b/README.md
index 68c9958..f0b9a8b 100644
--- a/README.md
+++ b/README.md
@@ -19,7 +19,7 @@ If `$HOME/.config/automedia/download_finished.sh` exists then it's called when a
curl, transmission-cli, notify-send (optional)
## Python 3
lxml, requests, pure_protobuf (optional, used with mangaplus.shueisha.co.jp)
-# Requirements when using open_media.py
+# Requirements when using tools/open_media.py
## System
dmenu, sxiv (for manga), mpv (for anime)
# Important
diff --git a/automedia b/automedia
index 153febf..06f1339 100755
--- a/automedia
+++ b/automedia
Binary files differ
diff --git a/src/main.c b/src/main.c
index a5ab5d9..ea54701 100644
--- a/src/main.c
+++ b/src/main.c
@@ -645,7 +645,7 @@ static void command_sync(int argc, char **argv, char *rss_config_dir, char *html
}
fprintf(stderr, "Overwriting existing %s\n", automedia_pid_path);
- remove(automedia_pid_path);
+ unlink(automedia_pid_path);
pid_file = open(automedia_pid_path, O_CREAT | O_EXCL | O_SYNC | O_RDWR, 0666);
}
@@ -655,20 +655,21 @@ static void command_sync(int argc, char **argv, char *rss_config_dir, char *html
}
signal(SIGINT, automedia_pid_signal_handler);
+ signal(SIGTERM, automedia_pid_signal_handler);
char process_pid_str[32];
snprintf(process_pid_str, sizeof(process_pid_str), "%d", getpid());
int process_pid_str_len = strlen(process_pid_str);
if(write(pid_file, process_pid_str, process_pid_str_len) != process_pid_str_len) {
fprintf(stderr, "Failed to write pid to %s\n", automedia_pid_path);
- remove(automedia_pid_path);
+ unlink(automedia_pid_path);
exit(1);
}
close(pid_file);
const int sync_rate_sec = 15 * 60; /* every 15 min */
sync_rss_html(rss_config_dir, html_config_dir, program_dir, download_dir, sync_rate_sec);
- remove(automedia_pid_path);
+ unlink(automedia_pid_path);
}
static void command_downloaded(int argc, char **argv, const char *rss_config_dir, const char *html_config_dir) {
diff --git a/list-by-updated.sh b/tools/list-by-updated.sh
index 61b9a0e..61b9a0e 100755
--- a/list-by-updated.sh
+++ b/tools/list-by-updated.sh
diff --git a/list-missing-unwatched.py b/tools/list-missing-unwatched.py
index 980c500..980c500 100755
--- a/list-missing-unwatched.py
+++ b/tools/list-missing-unwatched.py
diff --git a/list-unwatched.py b/tools/list-unwatched.py
index 874df7b..874df7b 100755
--- a/list-unwatched.py
+++ b/tools/list-unwatched.py
diff --git a/open_media.py b/tools/open_media.py
index 66d8ed7..66d8ed7 100755
--- a/open_media.py
+++ b/tools/open_media.py
diff --git a/track.py b/tools/track.py
index d56d8b3..d56d8b3 100755
--- a/track.py
+++ b/tools/track.py