Commit Graph
100 Commits
Author SHA1 Message Date
tcely b520d75f20 Fixes from tests 2025-03-01 09:39:54 -05:00
tcely 189569cc82 Use media_file only when it is set 2025-03-01 09:33:22 -05:00
tcely b6efd9dc5e Handle files that weren't renamed too
The filename may be different, do try the old name in the new directory also.
2025-03-01 09:00:36 -05:00
tcely c497a74ebe Don't skip when either path exists 2025-03-01 08:43:34 -05:00
tcely bf90a191a8 Save the existing file to the media_file field
The computed file path is adjusted for the new source directory location, so use this to update the old path to the new path after a source directory is renamed.
2025-03-01 08:39:03 -05:00
tcely 7ed7527815 Set Media.skip to False
This handles a bad interaction between files that were deleted by the user externally and need to be skipped and files that were temporarily indistinguishable from that case.

The source directory changing invalidates the absolute paths, but those should be corrected later. Leaving skip set causes display problems.
2025-03-01 07:43:30 -05:00
tcely 14c3b99ef1 Be better about errors during the renaming process 2025-03-01 04:06:58 -05:00
tcely 8b611aa71b There is a _ already 2025-03-01 00:12:17 -05:00
tcely d1f6c8184a Merge directories and remove empty directory 2025-03-01 00:01:50 -05:00
tcely 844fce3c90 Avoid the while loop 2025-02-28 22:59:49 -05:00
tcely 8c465f0afe Handle more cases
This should now handle:

- adding a sub-directory
- removing a sub-directory
2025-02-28 22:51:52 -05:00
tcely f41faa444d Rename to a temporary path then final destination
Fixes #798
2025-02-28 20:45:21 -05:00
tcely fd0743986b Restrict PYTHONPYCACHEPREFIX to pipenv
It turns out `apt` and friends don't play nicely with that variable.
2025-02-28 17:41:59 -05:00
tcely 0703032fcf Be more user-friendly when sorting tasks
The time first, then the priority, if the tasks are at the same time.
2025-02-28 16:51:53 -05:00
tcely b38237803a Do not lose track of downloaded files 2025-02-28 16:24:01 -05:00
tcely a993240b96 Better display of large numbers 2025-02-28 15:50:31 -05:00
tcely ff6a858783 Humanize the numbers for each category
This is important for scheduled higher than 1,000 mostly.
2025-02-28 15:41:33 -05:00
tcely b31e26b964 Allow filtering tasks by source 2025-02-28 15:15:35 -05:00
tcely fdbea30f74 Improve readability 2025-02-28 14:25:45 -05:00
tcely b2c1748d62 Switch to total_scheduled in views.py 2025-02-28 14:16:11 -05:00
tcely 4f32e63047 Switch to total_scheduled in tasks.html 2025-02-28 14:14:57 -05:00
tcely 174d9d46e8 Use scheduled_total instead of scheduled for this page 2025-02-28 14:11:15 -05:00
tcely c81f0854e0 Add scheduled_total to the context 2025-02-28 14:10:07 -05:00
tcely 0786933c5f Tweak the comment 2025-02-28 14:04:29 -05:00
tcely fcc37100c3 python -B is well-behaved
Use the `tmpfs` mount on `/cache` instead of `/tmp` to make this faster.
2025-02-28 13:44:19 -05:00
tcely 63f3df1d5c Clean up __pycache__ directories 2025-02-28 12:45:36 -05:00
tcely b61061d3c1 Keep the rows distinct 2025-02-28 02:10:20 -05:00
tcely 2d4e23a8d7 Pagination for scheduled tasks
Keep showing running and errors on every page.
2025-02-28 01:58:06 -05:00
tcely b78075557a Add pagination for scheduled tasks 2025-02-28 01:32:32 -05:00
tcely ddc9588cbf Set daterange for yt-dlp when indexing 2025-02-27 10:50:00 -05:00
tcely fd4f917b05 Pass days to indexer function 2025-02-27 10:14:33 -05:00
tcely e04562d8be Add the port to the Host header
Without this, port 80 may be assumed, which would be incorrect.
2025-02-27 08:59:21 -05:00
tcely beeaafe246 Use the values from nginx for CSRF Origin checks 2025-02-27 08:51:09 -05:00
tcely e2dd61af66 Pass through forwarded Host & Port 2025-02-27 08:43:14 -05:00
tcely b0ea486302 Prevent unintended unhealthy restarts
When I intentionally set a test container to be down,
I really don't want it to be restarted because it was "unhealthy" for too long
2025-02-26 07:39:23 -05:00
tcely 533c1631b7 Store Media.downloaded_filesize for imported files
Fixes #69
2025-02-25 04:13:02 -05:00
tcely fff42cec09 fixup: remove the extra blank line 2025-02-25 03:36:11 -05:00
tcely 921e053fc3 Remove unnecessary chmod executions
Setting the mode to the same value twice is only wasted effort.
2025-02-25 03:34:02 -05:00
tcely fd423fba88 Check for the cached dictionary first 2025-02-24 14:57:53 -05:00
tcely c9f4a5dc17 Use the standard sqlite3 engine from Django 5.1 2025-02-24 10:42:30 -05:00
tcely 91523edc21 Delete tubesync/tubesync/sqlite3/base.py 2025-02-24 10:40:54 -05:00
tcely 1ad90ad628 Access posix_epoch correctly
Fixes #768
2025-02-24 10:11:06 -05:00
tcely 7ebd23c070 Prevent unintended changes to the cached dictionary 2025-02-24 06:27:23 -05:00
tcely 822db9d039 Delete tubesync/tubesync/celery.py 2025-02-24 04:58:56 -05:00
tcely 2f044c3614 Remove hiredis & redis from Pipfile 2025-02-24 04:54:53 -05:00
tcely a111da9104 Delete config/root/etc/s6-overlay/s6-rc.d/celery-beat/type 2025-02-24 04:39:04 -05:00
tcely 3f93d0ae34 Delete config/root/etc/s6-overlay/s6-rc.d/celery-beat/dependencies 2025-02-24 04:38:53 -05:00
tcely b474e9e817 Delete config/root/etc/s6-overlay/s6-rc.d/celery-beat/run 2025-02-24 04:38:45 -05:00
tcely 3d1cc110ac Delete config/root/etc/s6-overlay/s6-rc.d/celery-worker/type 2025-02-24 04:37:46 -05:00
tcely 1ba97749df Delete config/root/etc/s6-overlay/s6-rc.d/celery-worker/run 2025-02-24 04:37:37 -05:00
tcely 170671d4ec Delete config/root/etc/s6-overlay/s6-rc.d/celery-worker/dependencies 2025-02-24 04:37:25 -05:00
tcely bd5dbbd295 Delete config/root/etc/s6-overlay/s6-rc.d/redis/type 2025-02-24 04:33:28 -05:00
tcely e0b98f34b7 Delete config/root/etc/s6-overlay/s6-rc.d/redis/dependencies 2025-02-24 04:33:14 -05:00
tcely 44910edbb1 Delete config/root/etc/s6-overlay/s6-rc.d/redis/run 2025-02-24 04:33:00 -05:00
tcely 0e4c5b10c9 Delete config/root/etc/redis/redis.conf 2025-02-24 04:32:26 -05:00
tcely b4c4825c2a Remove redis-server from Dockerfile 2025-02-24 04:30:59 -05:00
tcely ce68ba9a01 Drop Python 3.7 as unsupported 2025-02-24 02:51:36 -05:00
tcely 83203254ad Patched for version 1.2.8 2025-02-24 02:47:37 -05:00
tcely eeb1826b05 Upgrade to 1.2.8 for Django 5 support. 2025-02-24 02:45:41 -05:00
tcely 7c2ba576f6 Return a copy instead of modifying the input 2025-02-23 18:20:35 -05:00
tcely 3e2337d4a9 fixup: only return filtered data when appropriate 2025-02-23 17:58:15 -05:00
tcely be0cbd6cd0 Be more efficient with Media.loaded_metadata 2025-02-23 17:47:54 -05:00
tcely 0d73519946 Fix an internal server error 2025-02-22 14:45:53 -05:00
tcely c5c340b58f Optimize rename_files 2025-02-22 12:59:06 -05:00
tcely 9d328df671 We need to keep the repeating index task 2025-02-22 12:08:35 -05:00
tcely b3a21f2e27 fixup: quoting 2025-02-22 11:55:14 -05:00
tcely a9db563990 Be more consistent with fmt
This was the cause of many rename operations.
2025-02-22 11:50:48 -05:00
tcely 56bd3288b4 Match the priority of the other index tasks 2025-02-22 10:38:30 -05:00
tcely 8722a1dbe6 Match the priority of the other index tasks 2025-02-22 10:34:41 -05:00
tcely bf221394c3 Do not make the user wait when they are interacting 2025-02-22 10:27:19 -05:00
tcely 11190ada2d We still need to pin django also 2025-02-22 08:25:32 -05:00
tcely e5d124e807 Update rename_all_media_for_source
Include the recent optimizations.
2025-02-22 08:04:44 -05:00
tcely 526224f1bb Move rename_media task creation to Media post save 2025-02-22 07:29:01 -05:00
tcely b5dcf41097 Log not existing source pre save
I think this is not only possible, but happens regularly.
2025-02-22 07:05:44 -05:00
tcely 599d596368 Add scheduling delays
This is an attempt to stop duplicated tasks from running at the same time.
2025-02-22 06:53:28 -05:00
tcely 976101781d Connect the UI for Jellyfin
* Add Jellyfin media server type

* Add and use `forms_dict` and `long_types` methods

* Add `JellyfinMediaServerForm`

* Use `JellyfinMediaServer`

* Add and use `MediaServerType.handlers_dict` method

* Do not hard-code `plex`

* Also map backwards in `MediaServerType.long_types`

* Use the long server type for URLs

* Loop over media server type names

* Add `MediaServerType.long_type` property

* Add `media_server_types` to template context

* Use the `MediaServerType.members_list` class method

* Port is already part of the URL
2025-02-22 05:49:03 -05:00
tcely e25a9cd228 Merge branch 'meeb:main' into jellyfin-mediaserver 2025-02-21 22:34:33 -05:00
tcely 6a80758c9b Check for the database vendor first 2025-02-21 12:07:32 -05:00
tcely c9bc7bf84e Correct the syntax 2025-02-21 07:44:20 -05:00
tcely b11b906497 Pin django-background-tasks
It's `django-background-tasks` that limits the Django version.
2025-02-21 07:30:26 -05:00
tcely 225ff0d64e Process renaming after downloads 2025-02-21 06:54:42 -05:00
tcely e727e30ece Simplify the get_queryset function 2025-02-21 05:18:00 -05:00
tcely 29197d241a Remove duplicate function 2025-02-21 05:01:29 -05:00
tcely 986dc17013 Use multiple threads for renaming
A single thread is much too slow for hundreds, or more, rename tasks.

With at least two, one thread can be loading while another is being processed. The times when nothing is happening are reduced significantly.
2025-02-21 04:19:12 -05:00
tcely 78977bbdec Limit the try and log what happened for debugging 2025-02-20 23:24:10 -05:00
tcely 95774a0d2c Do not let one private video hold up the rest 2025-02-20 23:16:13 -05:00
tcely 4591d3867b Ask for formats that might not work and test them 2025-02-19 21:37:55 -05:00
tcely b65a0ff759 Remove the useless "not skipping" logged messages 2025-02-19 18:30:45 -05:00
tcely 5f81c3619f fixup: convert seconds with timedelta 2025-02-19 18:03:17 -05:00
tcely b01af70098 Try to refresh formats after download failed 2025-02-19 17:48:18 -05:00
tcely ad8fa72123 Try to refresh formats while checking media 2025-02-19 17:34:20 -05:00
tcely 16cd0983c9 Add refresh_formats property 2025-02-19 17:18:20 -05:00
tcely 9d3d997e9a Select a combined format if nothing else is available 2025-02-19 00:53:05 -05:00
tcely ed3136c7a8 Defer Media.metadata inside rename_media task 2025-02-18 21:12:40 -05:00
tcely 18a170a8e0 Defer fields for rename_media task creation 2025-02-18 20:59:30 -05:00
tcely 852d0cf0f2 Bump ffmpeg build 2025-02-18 19:19:41 -05:00
tcely be740dfb7f Merge branch 'meeb:main' into jellyfin-mediaserver 2025-02-18 19:12:26 -05:00
tcely d8e9fa21fd Use the default cache path for yt-dlp 2025-02-18 19:03:32 -05:00
tcely 74780220f4 Add XDG_CACHE_HOME environment variable 2025-02-18 18:56:12 -05:00
tcely 03f0680d0b Prefer fulltitle but do not require it 2025-02-17 23:32:06 -05:00