diff --git a/src/FMN.webp b/src/FMN.webp deleted file mode 120000 index a7b57da..0000000 --- a/src/FMN.webp +++ /dev/null @@ -1 +0,0 @@ -FMN_prev.webp \ No newline at end of file diff --git a/src/FMN.webp b/src/FMN.webp new file mode 100644 index 0000000..18b0741 Binary files /dev/null and b/src/FMN.webp differ diff --git a/src/FMN_prev.webp b/src/FMN_prev.webp deleted file mode 100644 index 18b0741..0000000 Binary files a/src/FMN_prev.webp and /dev/null differ diff --git a/src/fedi_api.py b/src/fedi_api.py index 20764cf..0a18c99 100644 --- a/src/fedi_api.py +++ b/src/fedi_api.py @@ -80,7 +80,7 @@ def get_status(status_id): logger.info(f'Retrying get status {status_id}') -def post_status(text, reply_to_status_id=None, poll_options=None, poll_expires=345600, attachments=None, visibility='unlisted'): +def post_status(text, reply_to_status_id=None, poll_options=None, poll_expires=345600, attachments=None): poll = None if poll_options is not None: poll = { @@ -91,7 +91,7 @@ def post_status(text, reply_to_status_id=None, poll_options=None, poll_expires=3 params = { "status": text, "in_reply_to_id": reply_to_status_id, - "visibility": visibility, + "visibility": "unlisted", "content_type": "text/plain", "language": "ru", "poll": poll diff --git a/src/listener_mention.py b/src/listener_mention.py index 91d1fe8..d1d2e46 100644 --- a/src/listener_mention.py +++ b/src/listener_mention.py @@ -58,33 +58,6 @@ def get_control_mention(): time.sleep(0.2) mark_as_read_notification(i['id']) - states_stor.states['max_mute_time'] = int(max_mute_time) - states_stor.states['stop_thread_scan'] = int(stop_thread_scan) - states_stor.states['last_thread_id'] = st_id - write_states(states_stor.states) - break - if now_hour == 0: - logger.warning(f'Автоматический триггер в полночи сработал') - st_date = time_now - thread_created_at = dateutilparse(st_date) - - delta = relativedelta(hour=hour_poll_posting, minute=0, second=0, weekday=TU(1)) - stop_thread_scan = thread_created_at + delta - movies_accept_time = stop_thread_scan.strftime('%H:%M %d.%m.%Y по Москве') - stop_thread_scan = time.mktime(time.struct_time(stop_thread_scan.timetuple())) - - if now_week == 6: # Фикс стыков двух недель. Если вс, то расчитываем на следующую неделю - next_week = 2 - else: - next_week = 1 - next_movie_watching_delta = relativedelta(hour=fmn_next_watching_hour, minute=0, second=0, weekday=SU(next_week)) - next_movie_watching = time_now + next_movie_watching_delta - max_mute_time = time.mktime(time.struct_time(next_movie_watching.timetuple())) # Глушение до следующего сеанса FMN. - next_movie_watching = next_movie_watching.strftime('%d.%m.%Y') - st_id = post_status(start_collect_movies_text(movies_accept_time, next_movie_watching) + '\n\n@rf@mastodon.ml', None, attachments=[upload_attachment('src/FMN.webp')], "public")['id'] - - time.sleep(0.2) - states_stor.states['max_mute_time'] = int(max_mute_time) states_stor.states['stop_thread_scan'] = int(stop_thread_scan) states_stor.states['last_thread_id'] = st_id