Commit Graph

1381 Commits

Author SHA1 Message Date
tcely
477753b88d
Remove forcejson option
As far as I can tell, this option only caused a lot of JSON output to be logged.
2024-12-20 08:18:40 -05:00
tcely
2ee635118b
Added logging to rename_files
Also, the fuzzy matching, by key in the filename, begins at the source directory.
2024-12-20 02:56:31 -05:00
tcely
4f56ebd1ce
Depend on the function to write a temporary file 2024-12-19 21:34:28 -05:00
tcely
72e4095354
Use TypeError in glob_quote 2024-12-19 21:26:10 -05:00
tcely
e204dea3e2
Use tempfile for write_text_file
This is more atomic and allows for checking `filepath`
before replacing the original file.
2024-12-19 20:32:52 -05:00
tcely
344759e522
Try not to leave empty directories around 2024-12-19 18:18:23 -05:00
tcely
521b903faa
Try to rename lost files by key 2024-12-19 18:01:30 -05:00
tcely
e3bcd78338
Use glob_quote in models.py 2024-12-19 17:28:15 -05:00
tcely
9168e82e8e
Add glob_quote 2024-12-19 17:20:06 -05:00
tcely
35912f0fe0
Use directory_and_stem in models.py 2024-12-19 16:56:31 -05:00
tcely
0e18d6d2bf
Don't return suffixes
This isn't useful.
The caller can create a `Path` to get this instead.
2024-12-19 16:46:11 -05:00
tcely
02f1d08570
Use mkdir_p in models.py 2024-12-19 16:36:15 -05:00
tcely
80a7718a64
Use mkdir_p in youtube.py 2024-12-19 16:30:43 -05:00
tcely
a33620f555
Add directory_and_stem and mkdir_p 2024-12-19 16:09:10 -05:00
Richard Hyde
919d933d4d mark the video as skipped if the sync.tasks.download_media_metadata task fails 2024-12-19 18:44:35 +00:00
Richard Hyde
ca61df2e0b don't add the sync.tasks.download_media_metadata task if the video is skipped or there's already a task running 2024-12-19 18:42:14 +00:00
Richard Hyde
435885ff61 added sync.tasks.download_media_metadata to the task map 2024-12-19 18:39:19 +00:00
Richard Hyde
6ae2676b8f Ignore case when checking the filter 2024-12-19 18:18:33 +00:00
tcely
3a2157e9b3
Use the database values in the current instance 2024-12-18 05:11:26 -05:00
tcely
2ffeb5e8ea
Avoid glob matching the video itself 2024-12-18 04:58:47 -05:00
tcely
9be9b0c58a
More fixes after glob worked
stem should be:
1) a stem
2) a string

Replace temporary .nfo into the new directory.
2024-12-18 03:52:51 -05:00
tcely
4b17c08fa5
Fixup use of _glob_translation 2024-12-18 03:18:17 -05:00
tcely
40aed6fc5b
Escape fnmatch special characters in old_stem 2024-12-18 02:58:33 -05:00
tcely
8f0825b57f
Rewrite the .nfo file when the thumb path changed 2024-12-18 01:08:14 -05:00
tcely
278a92b7e1
Prioritize rename before checking for new media 2024-12-17 22:50:04 -05:00
tcely
fdbfd33cc7
Fixes from testing
I don't know how I missed `.suffix` on the later `stem` loop. Oops.
2024-12-17 22:27:37 -05:00
meeb
52865cb5b4
Merge pull request #585 from tcely/patch-1
Some checks failed
Run Django tests for TubeSync / test (3.7) (push) Has been cancelled
Run Django tests for TubeSync / test (3.8) (push) Has been cancelled
Run Django tests for TubeSync / test (3.9) (push) Has been cancelled
Run Django tests for TubeSync / containerise (push) Has been cancelled
Remove unused timedelta import
2024-12-18 13:33:15 +11:00
tcely
4193e79d0c
Ensure the directory exists 2024-12-17 19:29:20 -05:00
tcely
ba0449bd0c
Import rename_all_media_for_source too 2024-12-17 18:36:20 -05:00
tcely
b8ec33bba0
Hook up renaming to source_post_save 2024-12-17 18:24:13 -05:00
tcely
daaebc9c63
Add 'rename_all_media_for_source' to TASK_MAP 2024-12-17 18:13:47 -05:00
tcely
218c3e6dff
Add Media.rename_files 2024-12-17 17:39:02 -05:00
tcely
d85fb92b2e
Remove unused timedelta import 2024-12-17 15:29:34 -05:00
tcely
10c5a989c0
Adjust to accurate function in logged error 2024-12-17 15:22:13 -05:00
tcely
11d9711907
Add rename_all_media_for_source function 2024-12-12 17:46:03 -05:00
tcely
730275746d
Use django.db.connection as suggested 2024-12-12 15:19:54 -05:00
tcely
5ee295db01
Keep the argument extraction in the function 2024-12-12 14:05:23 -05:00
tcely
11789df864
Pass the exception argument
Fixed up the try syntax too.
I really dislike try, but it's almost mandatory in Python.
2024-12-12 13:59:06 -05:00
tcely
ba0d5ab285
Regex and syntax tweaks
I didn't pay close enough attention to the try grammar.
2024-12-12 13:33:17 -05:00
tcely
36b395ae30
Don't pass the exception to _remove_invalid_keyword_argument 2024-12-12 12:31:30 -05:00
tcely
3fe7203ed5
Add and use _remove_invalid_keyword_argument 2024-12-12 12:13:27 -05:00
tcely
41215b9148
Automated invalid keyword argument removal
Less manual maintenance as versions change is a win!
2024-12-12 11:14:17 -05:00
tcely
32dead2126
Proof of concept for automated param removal 2024-12-12 10:35:46 -05:00
tcely
7b033d6e62
Use a filter map to make maintenance easier
A possible future improvement would be to define a map of which keys Connection accepts.

Right now, this is removing keys after Connection fails because of an unknown key.

This could be automated by using try and removing a key each time the exception is caught.
2024-12-12 09:52:51 -05:00
tcely
21e9cbef4b
Cleanup for _start_transaction_under_autocommit 2024-12-12 09:03:08 -05:00
tcely
de52e55e34
Return get_new_connection
Oops. It helps to have the resulting connection.
2024-12-11 16:30:48 -05:00
tcely
ebf1ed3ef4
Filter out the init_command key
TypeError: 'init_command' is an invalid keyword argument for Connection()
2024-12-11 16:04:09 -05:00
tcely
467ec947ff
Configure isolation_level from transaction_mode
TypeError: 'transaction_mode' is an invalid keyword argument for Connection()
2024-12-11 15:48:11 -05:00
tcely
0ab0605d22
Keep legacy_alter_table off
Newer Django will set this for us,
but it won't matter if it is disabled twice.
2024-12-11 13:42:05 -05:00
tcely
7e872bf8b5
Use tubesync.sqlite3 2024-12-11 13:35:12 -05:00