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

Movie stays on "Not Available" when skipping the cinema release #4920

Closed
reloxx13 opened this issue Aug 27, 2020 · 7 comments · Fixed by #4921
Closed

Movie stays on "Not Available" when skipping the cinema release #4920

reloxx13 opened this issue Aug 27, 2020 · 7 comments · Fixed by #4921
Labels
Type: Bug Issue is a bug
Milestone

Comments

@reloxx13
Copy link
Contributor

reloxx13 commented Aug 27, 2020

Describe the bug
If a movie only gets release digital and not cinema, the movie will stay in "Not Available" state if the minimum availability is set to in cinemas.
The icon next to the movie title in the movie list says "released". Released is after the in cinema flag.
It should get the "Missing" state.

This causes a alot of movie not beeing watched to grab.

A wokaround is to set minimum availability to "Announced", but this way also movies announced for 2021+ will be searched.
Causing higher api rates when using manual "seach all".

There is also no posibillity to make a custom filter with movies which have no cinema date (that way it would be possible to set a tag and change those movies minimum availability to released).

To Reproduce
Choose/Add a movie which has skipped cinema and is released (alot of n**f*ix movies).
Set minimum availability to in cinemas and in indexer settings availability delay -14days
=> Movies hat "not available" flag and will not occur in "wanted" filter.

Expected behavior
A clear and concise description of what you expected to happen.

Platform Information (please complete the following information):

  • OS: Win10x64
  • Radarr Version: Latest Aphrodite 3.0.0.3497

Debug Logs
I can send it over Discord PN

@reloxx13 reloxx13 added the Type: Bug Issue is a bug label Aug 27, 2020
@bakerboy448
Copy link
Contributor

Do you have a few example movies to share?

@austinwbest
Copy link
Contributor

Without looking at the code yet, i could see this happening if there is no date from TMDb to use and base the delay off of. If there isn't a check, there simply needs to be a check for cinema data before allowing to set it or after the data is grabbed, change it from cinema to release when it has to or just leave it at cinema and fall back to release internally.

Quite a few options can resolve this if it isn't doing anything yet

@reloxx13
Copy link
Contributor Author

reloxx13 commented Aug 27, 2020

Do you have a few example movies to share?

tt3993886
grafik

Without looking at the code yet, i could see this happening if there is no date from TMDb to use and base the delay off of. If there isn't a check, there simply needs to be a check for cinema data before allowing to set it or after the data is grabbed, change it from cinema to release when it has to or just leave it at cinema and fall back to release internally.

Quite a few options can resolve this if it isn't doing anything yet

but still, the icon left to the movie name detects that the movie is released.
this detection must be diffrent between the available state icon code and (monitor) state code.

@geogolem
Copy link
Contributor

geogolem commented Aug 27, 2020

im looking in the code now, and i see where this is happening.

There is a function public bool IsAvailable(int delay = 0) in src\NzbDrone.Core\Movies\Movie.cs

A quick glance and i think I see the issue, but need to look at it a bit to figure out exactly what is going on and how to fix it.

Here is the full function:

public bool IsAvailable(int delay = 0)
        {
            //the below line is what was used before delay was implemented, could still be used for cases when delay==0
            //return (Status >= MinimumAvailability || (MinimumAvailability == MovieStatusType.PreDB && Status >= MovieStatusType.Released));

            //This more complex sequence handles the delay
            DateTime minimumAvailabilityDate;
            switch (MinimumAvailability)
            {
                case MovieStatusType.TBA:
                case MovieStatusType.Announced:
                    minimumAvailabilityDate = DateTime.MinValue;
                    break;
                case MovieStatusType.InCinemas:
                    if (InCinemas.HasValue)
                    {
                        minimumAvailabilityDate = InCinemas.Value;
                    }
                    else
                    {
                        minimumAvailabilityDate = DateTime.MaxValue;  //this is the bad situation
                    }

                    break;

                case MovieStatusType.Released:
                case MovieStatusType.PreDB:
                default:
                    if (PhysicalRelease.HasValue && DigitalRelease.HasValue)
                    {
                        minimumAvailabilityDate = new DateTime(Math.Min(PhysicalRelease.Value.Ticks, DigitalRelease.Value.Ticks));
                    }
                    else if (PhysicalRelease.HasValue)
                    {
                        minimumAvailabilityDate = PhysicalRelease.Value;
                    }
                    else if (DigitalRelease.HasValue)
                    {
                        minimumAvailabilityDate = DigitalRelease.Value;
                    }
                    else
                    {
                        minimumAvailabilityDate = InCinemas.HasValue ? InCinemas.Value.AddDays(90) : DateTime.MaxValue;
                    }

                    break;
            }

            if (HasPreDBEntry && MinimumAvailability == MovieStatusType.PreDB)
            {
                return true;
            }

            if (minimumAvailabilityDate == DateTime.MinValue || minimumAvailabilityDate == DateTime.MaxValue)
            {
                return DateTime.Now >= minimumAvailabilityDate;
            }

            return DateTime.Now >= minimumAvailabilityDate.AddDays((double)delay);
        }

I added that comment //this is the bad situation. I think that situation, needs to fall through and still do the stuff that would happen if minimumAvailability was set to released...

@geogolem
Copy link
Contributor

i think making this change should fix it:

MovieStatusType effectiveMinimumAvailability = (MinimumAvailability == MovieStatusType.InCinemas && !InCinemas.HasValue) ? MovieStatusType.Released : MinimumAvailability;
            switch (effectiveMinimumAvailability)
            {
                case MovieStatusType.TBA:
                case MovieStatusType.Announced:
                    minimumAvailabilityDate = DateTime.MinValue;
                    break;
                case MovieStatusType.InCinemas:
                    if (InCinemas.HasValue)
                    {
                        minimumAvailabilityDate = InCinemas.Value;
                    }
                    else
                    {
                        //this branch should never be taken because of the check before the switch
                        minimumAvailabilityDate = DateTime.MaxValue; //this is a problem what if we dont have inCinemas date but we have digital/release dates
                    }

                    break;

I just need to reproduce with your test movie before the change and see what happens with the change..

@geogolem
Copy link
Contributor

geogolem commented Aug 27, 2020

OK, so i think the above fix solves the problem; however, I think I should not use the switch and just an if structure - so I am cleaning the code up a bit. Will create a branch/PR with cleaned up code soon.

I usually use MinimumAvailability of Released, so I never noticed this. I think I just overlooked the case when InCinemas release date is missing when I initially implemented MinimumAvailability.

@geogolem
Copy link
Contributor

geogolem commented Aug 27, 2020

You might want to create another issue for a feature request to add filter support for MinimumAvailability (if you want), if it doesnt already exist. that might have allowed you to workaround this issue, but it wasn't a solution - though it could be a useful feature...

EDIT: it seems there is an old but interesting similar/potentially related feature request here: #2074

@Qstick Qstick added this to the 3.0 milestone Aug 28, 2020
Qstick pushed a commit that referenced this issue Sep 5, 2020
* if minimumAvailability is set to InCinemas
InCinemas has no value but physical/digital release dates
are known and passed, movie would be marked as Not Available
When it should be Missing.

This resolves #4920

remove comment

* add the tests
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Type: Bug Issue is a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants