[x] I have tested my changes against the dev branch (the latest developmental version), and this pull request is targeting that branch as a base
[x] I have tested my changes on Python 3.10.12
[x] I have ensured my code is formatted using Black and Flake8
Description
Yet another cache-related PR, and easily the biggest. This PR primarily focuses on adding the StorageRetainAutoPlay option to allow autoplaylist cache to be retained regardless of the other cache settings. The retention depends on SaveVideos being enabled still.
The option can only retain autoplaylist entries that have been stored in the cachemap. Cachemap entries are stored only when they are played. Rational for this design is taken from the fact that the autoplaylist.txt file can be an arbitrarily large size, and extracting information on each entry would be too time consuming to do at start-up.
Currently the "cachemap" is a JSON file associating filenames without extensions to their respective URL in the autoplaylist file. The cachmap is named using the filename stem of the autoplaylist file, and saved in the same folder with the original list file.
This PR resulted in a sizable refactor of the cache related code and some of the code related to autoplaylist management.
Much of it has been tested, but some edge cases like ContentTooShortError processing will likely need testing in the wild and future adjustment.
Related issues
1854
1549
173
This also checks a box in planned features issue # 1 ;)
dev
branch (the latest developmental version), and this pull request is targeting that branch as a baseDescription
Yet another cache-related PR, and easily the biggest. This PR primarily focuses on adding the
StorageRetainAutoPlay
option to allow autoplaylist cache to be retained regardless of the other cache settings. The retention depends onSaveVideos
being enabled still.The option can only retain autoplaylist entries that have been stored in the cachemap. Cachemap entries are stored only when they are played. Rational for this design is taken from the fact that the autoplaylist.txt file can be an arbitrarily large size, and extracting information on each entry would be too time consuming to do at start-up.
Currently the "cachemap" is a JSON file associating filenames without extensions to their respective URL in the autoplaylist file. The cachmap is named using the filename stem of the autoplaylist file, and saved in the same folder with the original list file.
This PR resulted in a sizable refactor of the cache related code and some of the code related to autoplaylist management.
Much of it has been tested, but some edge cases like
ContentTooShortError
processing will likely need testing in the wild and future adjustment.Related issues
1854
1549
173
This also checks a box in planned features issue # 1 ;)