Repository: Ombi-app/Ombi (2026-06-15T06:12:07Z)

Issue:
New TV shows that have yet to air are showing up as "Available"
### Summary

At some point after the visual redesign, Some TV Shows which were not available and are going to air in the future are marked as available on the discover page.  When you click on the show to view it the shows are shown at the show level as partially available even if the show has never been requested and none of the episodes show a status.

<img width="1030" height="396" alt="Image" src="https://github.com/user-attachments/assets/47a20454-e20d-4e2b-9571-6376c6c8fc87" />

<img width="1067" height="492" alt="Image" src="https://github.com/user-attachments/assets/3a92a48d-2919-426c-977f-e3688771f458" />

<img width="1035" height="559" alt="Image" src="https://github.com/user-attachments/assets/62ccca2f-0715-441c-8e8f-7df900be6088" />

### Ombi Version

4.53.10 and 4.60.3

### What platform(s) does this occur on?

Docker

### What database are you using?

MySQL

### Relevant log output

```shell

```


Discussion:

Patch:
diff --git a/src/Ombi.Core/Rule/Rules/Search/AvailabilityRuleHelper.cs b/src/Ombi.Core/Rule/Rules/Search/AvailabilityRuleHelper.cs
index 22c693082..566a9fc6b 100644
--- a/src/Ombi.Core/Rule/Rules/Search/AvailabilityRuleHelper.cs
+++ b/src/Ombi.Core/Rule/Rules/Search/AvailabilityRuleHelper.cs
@@ -40,9 +40,10 @@ public static void CheckForUnairedEpisodes(SearchTvShowViewModel search)
                         x.Episodes.Any(c => !c.Available && c.AirDate == DateTime.MinValue));
                     if (!unknownAirDateUnavailable)
                     {
-                        var hasUnairedEpisodes = search.SeasonRequests.Any(x =>
-                            x.Episodes.Any(c => !c.Available && c.AirDate > DateTime.Now.Date && c.AirDate != DateTime.MinValue));
-                        if (hasUnairedEpisodes || search.PartlyAvailable)
+                        // Only treat the remaining (unaired) episodes as non-blocking when we
+                        // actually have something available already. A show where nothing has
+                        // aired yet has no available episodes and must not be marked available.
+                        if (search.PartlyAvailable)
                         {
                             search.FullyAvailable = true;
                         }


Test patch:
diff --git a/src/Ombi.Core.Tests/Rule/Search/AvailabilityRuleHelperTests.cs b/src/Ombi.Core.Tests/Rule/Search/AvailabilityRuleHelperTests.cs
index 3b5ec8395..6e6dc56e2 100644
--- a/src/Ombi.Core.Tests/Rule/Search/AvailabilityRuleHelperTests.cs
+++ b/src/Ombi.Core.Tests/Rule/Search/AvailabilityRuleHelperTests.cs
@@ -168,6 +168,32 @@ public void Is_NotAvailable_When_All_We_Have_No_Aired_Episodes()
             Assert.That(model.FullyAvailable, Is.False);
             Assert.That(model.PartlyAvailable, Is.False);
         }
+        [Test]
+        public void Is_NotAvailable_When_No_Episodes_Have_Aired_Yet()
+        {
+            var episodes = new List<EpisodeRequests>
+            {
+                new EpisodeRequests
+                {
+                    AirDate = DateTime.Now.AddDays(1), // Tomorrow
+                    Available = false
+                },
+                new EpisodeRequests
+                {
+                    AirDate = DateTime.Now.AddDays(7), // Next week
+                    Available = false
+                }
+            };
+
+            var model = new SearchTvShowViewModel
+            {
+                SeasonRequests = new List<SeasonRequests> { new SeasonRequests { Episodes = episodes } }
+            };
+            AvailabilityRuleHelper.CheckForUnairedEpisodes(model);
+            Assert.That(model.FullyAvailable, Is.False);
+            Assert.That(model.PartlyAvailable, Is.False);
+        }
+
         [Test]
         public void Is_NotAvailable_When_All_Episodes_Are_Unknown()
         {