Skip to content
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

Closed
IrishPrime opened this issue Jun 11, 2022 · 0 comments · Fixed by #94
Closed

Create TV Class #88

IrishPrime opened this issue Jun 11, 2022 · 0 comments · Fixed by #94

Comments

@IrishPrime
Copy link
Owner

Create a TV class that implements the Media abstract base class. Metadata fields should include:

  • Series name
  • Season number
  • Episode number
  • Episode title
@IrishPrime IrishPrime self-assigned this Jun 11, 2022
@IrishPrime IrishPrime added this to To do in Object-Oriented Redesign via automation Jun 11, 2022
@IrishPrime IrishPrime moved this from To do to In progress in Object-Oriented Redesign Jun 11, 2022
@IrishPrime IrishPrime changed the title Create TV Class Create TV Class Jun 11, 2022
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.
@IrishPrime IrishPrime linked a pull request Dec 11, 2022 that will close this issue
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.
@IrishPrime IrishPrime moved this from In progress to Done in Object-Oriented Redesign Dec 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.

1 participant