Skip to content

Process wanted media with the oldest attempt date first #339

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 11, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/nefarious/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,8 @@ def wanted_media_task():
today = timezone.now().date()

for media_type, data in wanted_media_data.items():
for media in data['query']:
# process media with the oldest attempt first
for media in data['query'].order_by('last_attempt_date'):
# media has been released (or it's missing its release date so try anyway) so create a task to try and fetch it
if not media.release_date or media.release_date <= today:
logger_background.info('Wanted {type}: {media}'.format(type=media_type, media=media))
Expand Down