-
Notifications
You must be signed in to change notification settings - Fork 1
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
Create TV
Class
#88
Comments
IrishPrime
added a commit
that referenced
this issue
Dec 11, 2022
Add a `Media(TV)` class with fields for: - Series name - Season number - Episode number - Episode title Add a `Media.patterns` property. This property holds all the compiled regular expressions used to attempt to infer metadata for an instance based on its filename. Add `Media.load_patterns()` and `Media._load_patterns()` methods to allow each subclass to handle loading or generating patterns in their own way. Add a `Media.infer()` method which uses the filename and `Media.patterns` to infer the metadata. This metadata is passed to the `Media.set_metadata()` method, which must be implemented by each subclass, to further process or transform values before finally assigning them. Add a `Media._match()` helper method to perform matches for `Media.infer()` against `Media.patterns` and return the metadata. Improve documentation for the `nielsen.media` module. Add tests for new functionality. Resolve #88.
Merged
Merged
IrishPrime
added a commit
that referenced
this issue
Dec 11, 2022
Add a `Media(TV)` class with fields for: - Series name - Season number - Episode number - Episode title Change `nielsen.media.Media` to a normal class to allow for easier testing of the functions that subclasses inherit from it. Add `section` and `library` properties to the `Media` base class to make it easier to get configuration options from the correct section and ensure the destination directory for organizing files is always an absolute path to avoid ambiguity. Raise a `NotImplementedError` when trying to call `Media.infer()` to force sub-classes to implement it. Set default configuration operations with a `DEFAULT` dictionary at the module level to avoid forcing a call to `nielsen.config.load_config()` to set the defaults. If the module is imported, the defaults should be set. Add a brief description of the default configuration options. Use full option names in `vim` modelines for clarity. Use the string `Unknown` when coercing `TV` objects to `str` if the `series` or `title` attributes are empty or unset. Add a `Media.patterns` property. This property holds all the compiled regular expressions used to attempt to infer metadata for an instance based on its filename. Add `Media.load_patterns()` and `Media._load_patterns()` methods to allow each subclass to handle loading or generating patterns in their own way. Add a `Media.infer()` method which uses the filename and `Media.patterns` to infer the metadata. This metadata is passed to the `Media.set_metadata()` method, which must be implemented by each subclass, to further process or transform values before finally assigning them. Add a `Media._match()` helper method to perform matches for `Media.infer()` against `Media.patterns` and return the metadata. Improve documentation for the `nielsen.media` module. Add tests for new functionality. Resolve #88.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Create a
TV
class that implements theMedia
abstract base class. Metadata fields should include:The text was updated successfully, but these errors were encountered: