Repository navigation
Retain complete index keys - #1616
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
tcely
left a comment
There was a problem hiding this comment.
Because videos and streams are both essentially unlimited sized lists, we try to be as memory-efficient with them as is possible.
* feat: track published and processed media keys * chore: modify indexing and cleanup to include published keys
meeb
left a comment
There was a problem hiding this comment.
I would concur this needs some additional details. Have I missed something or does this just check a directory is in the download root during delete_all_media_for_source() with some bonkers AI tests?
islice() stopped register_key() at the stream allowance, so streams beyond the cap were missing from the published keys.
Restore the original argument checks and leave database cleanup unchanged. Before rmtree(), require the directory to be below DOWNLOAD_ROOT without resolving symbolic links, matching safe_join() in the source form. Replace the AST-based test with one that calls the task's func directly.
|
Right, so this PR is actually about not following symlinks? |
|
@meeb The diff being a bit confused is my fault. Some of the changes for the key tracking are already on the base branch. I'm happy to add those behind a setting. The rest of the changes do show in the diff view of this pull request. I've changed the base back to main and opened #1618 for the changes that were already on the old base testing branch. |
|
Thanks both, and thanks @tcely for the key-tracking rework.
The full Django suite passes locally (69 tests). |
|
@ryanduguid Regarding c5ab922: Yes, your new test helpfully pointed out that the lazy evaluation via It is probably best to split your deletion changes off into another pull request. They will need more thought and testing. I would be happy to merge this with the enhanced tests after those changes are no longer part of this pull request. Please also give some thought to how you would like to document the way this feature works when both settings are used. The wiki source is available as a submodule for your convenience. If you write some changes and include the new / modified files under |
|
Ah right, thanks @tcely makes more sense now. Nothing to add beyond your own comments for now. |
tcely asked for the source-directory removal guard to be split into its own pull request. The index test now checks the exact processing order for uncapped, half-full and full queues, matching index_media() before it also returned the published keys, and that the published keys cover media beyond the cap.
On documentation: happy to write the wiki section explaining how |
|
@ryanduguid Thanks. Once a setting name is decided, I will merge that pull request first and update your branch from |
…n with MAX_ENTRIES_PROCESSING An updated copy of the wiki's Settings page for tcely to commit to the wiki.
|
@tcely thanks. With #1618 settling on |
Copied to the wiki already.
|
@ryanduguid The wiki changes should be live already. Thanks for your contributions. |
Summary
Tests for the capped index queue and the published key set from #1618.
test_index_coverage.pychecks the exact processing order for an uncapped queue and for caps of 2 and 4, with and without streams. The expected orders are whatindex_media()produced before it also returned the published keys, so the rework doesn't change which media get processed or in what order.The source-directory removal guard has moved out of this PR, as requested. It will come back separately with more testing.
Tests
The full Django suite passes locally (67 tests, Python 3.14 on Linux).