Skip to content

Renamer Metadata Rework #1236

@da3dsoul

Description

@da3dsoul

Current Feature

Renaming is not done if data is missing, even if it's irrelevant.

Feature Changes

Rework the checks for missing metadata into the renamers themselves.

Step 1.

Make Plugin Abstractions depend on net8.0. There's no reason to limit it to netstandard. We can have default interfaces that way.

Step 2.

Change Episodes and Series to XRefs, which each provide an Episode and a Series. This adds some complication, but we can have an auto-getter to return only the episodes or series for backwards compat and simplification of code. The reason is that we can open XRef providers and data to plugins, as well as doing this check in the renamer:

        // We don't have all the data yet, so don't try to rename yet.
        if (xrefs.Count != episodes.Count)
            return new()
            {
                Success = false,
                ShouldRetry = false,
                ErrorMessage = $"Not enough data to do renaming for the recognized file. Missing metadata for {xrefs.Count - episodes.Count} episodes.",
            };

This would be changed to:

        // We don't have all the data yet, so don't try to rename yet.
        foreach (var xref in args.XRefs)
        {
            if (xref.Episode == null)
                return new()
                {
                    Result = false,
                    Message = $"Not enough data to do renaming for the recognized file. Missing metadata for episode in {xref.Series.Name}",
                };
        }

Step 3.

Add default implementations in the interfaces with calls to a helper to make implementation and extension easy for plugin devs.

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions