# `Laev.Seasons`
[🔗](https://github.com/alexdont/laev/blob/main/lib/laev/seasons.ex#L1)

How many episodes of a season have actually aired.

Written whenever laev asks TMDB about a season — which it does every time you
pick or play an episode — and read where asking is not an option: the home
screen, which never fetches, and which was offering episode 10 of a
nine-episode season on the strength of adding one and hoping.

Small and disposable. A wrong answer here only costs the Up Next row, so an
unknown season is treated as "maybe", and the file can be deleted without
consequence.

# `aired`

Episodes aired in this season, or nil when laev has never looked.

# `aired_seasons`

Aired seasons for a show, or nil when laev has never looked.

# `put`

Remember how many episodes of this season are out.

# `put_aired_seasons`

How many of a show's seasons have actually aired — TMDB lists the announced
ones too, and they are not something you can be behind on.

Written whenever a screen fetches a show's details, and read by the home
screen, which fetches nothing: it is how the count of shows to finish can
leave out the ones you are merely waiting on.

# `put_aired_seasons_many`

The same for many shows at once, in one write.

Which is the only safe way to do it from concurrent work: every writer here
reads the whole file, changes a key and writes it back, so eight tasks saving
one show each keep one of the eight. The screen that fetches a page of shows
collects them and saves once.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
