Skip to content

Commit

Permalink
REFACTOR: Rename TV Show to TV Series (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamayoung authored Sep 6, 2023
1 parent fbb8304 commit bb032f0
Show file tree
Hide file tree
Showing 119 changed files with 1,277 additions and 1,279 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Cache SPM
uses: actions/cache@v3
with:
path: .build
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
Expand Down
8 changes: 4 additions & 4 deletions Sources/TMDb/Certifications/CertificationService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ public final class CertificationService {
///
/// - Throws: TMDb error ``TMDbError``.
///
/// - Returns: A dictionary of TV show certifications.
///
public func tvShowCertifications() async throws -> [String: [Certification]] {
/// - Returns: A dictionary of TV series certifications.
///
public func tvSeriesCertifications() async throws -> [String: [Certification]] {
let certifications: Certifications
do {
certifications = try await apiClient.get(endpoint: CertificationsEndpoint.tvShow)
certifications = try await apiClient.get(endpoint: CertificationsEndpoint.tvSeries)
} catch let error {
throw TMDbError(error: error)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Foundation
enum CertificationsEndpoint {

case movie
case tvShow
case tvSeries

}

Expand All @@ -18,7 +18,7 @@ extension CertificationsEndpoint: Endpoint {
.appendingPathComponent("movie")
.appendingPathComponent("list")

case .tvShow:
case .tvSeries:
return Self.basePath
.appendingPathComponent("tv")
.appendingPathComponent("list")
Expand Down
16 changes: 8 additions & 8 deletions Sources/TMDb/Discover/DiscoverService.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation

///
/// Provides an interface for discovering movies and TV shows from TMDb.
/// Provides an interface for discovering movies and TV series from TMDb.
///
@available(iOS 14.0, tvOS 14.0, watchOS 7.0, macOS 11.0, *)
public final class DiscoverService {
Expand Down Expand Up @@ -52,9 +52,9 @@ public final class DiscoverService {
}

///
/// Returns TV shows to be discovered.
/// Returns TV series to be discovered.
///
/// [TMDb API - Discover: TV](https://developer.themoviedb.org/reference/discover-tv)
/// [TMDb API - Discover: TV Series](https://developer.themoviedb.org/reference/discover-tv)
///
/// - Precondition: `page` can be between `1` and `1000`.
///
Expand All @@ -64,17 +64,17 @@ public final class DiscoverService {
///
/// - Throws: TMDb error ``TMDbError``.
///
/// - Returns: Matching TV shows as a pageable list.
/// - Returns: Matching TV series as a pageable list.
///
public func tvShows(sortedBy: TVShowSort? = nil, page: Int? = nil) async throws -> TVShowPageableList {
let tvShowList: TVShowPageableList
public func tvSeries(sortedBy: TVSeriesSort? = nil, page: Int? = nil) async throws -> TVSeriesPageableList {
let tvSeriesList: TVSeriesPageableList
do {
tvShowList = try await apiClient.get(endpoint: DiscoverEndpoint.tvShows(sortedBy: sortedBy, page: page))
tvSeriesList = try await apiClient.get(endpoint: DiscoverEndpoint.tvSeries(sortedBy: sortedBy, page: page))
} catch let error {
throw TMDbError(error: error)
}

return tvShowList
return tvSeriesList
}

}
4 changes: 2 additions & 2 deletions Sources/TMDb/Discover/Endpoints/DiscoverEndpoint.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Foundation
enum DiscoverEndpoint {

case movies(sortedBy: MovieSort? = nil, people: [Person.ID]? = nil, page: Int? = nil)
case tvShows(sortedBy: TVShowSort? = nil, page: Int? = nil)
case tvSeries(sortedBy: TVSeriesSort? = nil, page: Int? = nil)

}

Expand All @@ -20,7 +20,7 @@ extension DiscoverEndpoint: Endpoint {
.appendingWithPeople(people)
.appendingPage(page)

case .tvShows(let sortedBy, let page):
case .tvSeries(let sortedBy, let page):
return Self.basePath
.appendingPathComponent("tv")
.appendingSortBy(sortedBy)
Expand Down
4 changes: 2 additions & 2 deletions Sources/TMDb/Genres/Endpoints/GenresEndpoint.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Foundation
enum GenresEndpoint {

case movie
case tvShow
case tvSeries

}

Expand All @@ -18,7 +18,7 @@ extension GenresEndpoint: Endpoint {
.appendingPathComponent("movie")
.appendingPathComponent("list")

case .tvShow:
case .tvSeries:
return Self.basePath
.appendingPathComponent("tv")
.appendingPathComponent("list")
Expand Down
8 changes: 4 additions & 4 deletions Sources/TMDb/Genres/GenreService.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation

///
/// Provides an interface for obtaining movie and TV show genres from TMDb.
/// Provides an interface for obtaining movie and TV series genres from TMDb.
///
@available(iOS 14.0, tvOS 14.0, watchOS 7.0, macOS 11.0, *)
public final class GenreService {
Expand Down Expand Up @@ -42,18 +42,18 @@ public final class GenreService {
}

///
/// Returns the list of official genres for TV shows.
/// Returns the list of official genres for TV series.
///
/// [TMDb API - Genres: TV List](https://developer.themoviedb.org/reference/genre-tv-list)
///
/// - Throws: TMDb error ``TMDbError``.
///
/// - Returns: A list of genres.
///
public func tvShowGenres() async throws -> [Genre] {
public func tvSeriesGenres() async throws -> [Genre] {
let genreList: GenreList
do {
genreList = try await apiClient.get(endpoint: GenresEndpoint.tvShow)
genreList = try await apiClient.get(endpoint: GenresEndpoint.tvSeries)
} catch let error {
throw TMDbError(error: error)
}
Expand Down
8 changes: 4 additions & 4 deletions Sources/TMDb/Models/CastMember.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ public struct CastMember: Identifiable, Codable, Equatable, Hashable {
public let id: Int

///
/// Cast member's identifier for the particular movie or TV show.
/// Cast member's identifier for the particular movie or TV series.
///
public let castID: Int?

///
/// Credit identifier for that particular movie or TV show.
/// Credit identifier for that particular movie or TV series.
///
public let creditID: String

Expand Down Expand Up @@ -52,8 +52,8 @@ public struct CastMember: Identifiable, Codable, Equatable, Hashable {
///
/// - Parameters:
/// - id: Cast member's identifier.
/// - castID: Cast member's identifier for the particular movie or TV show.
/// - creditID: Credit identifier for that particular movie or TV show.
/// - castID: Cast member's identifier for the particular movie or TV series.
/// - creditID: Credit identifier for that particular movie or TV series.
/// - name: Cast member's name.
/// - character: Cast member's character name.
/// - gender: Cast member's gender.
Expand Down
4 changes: 2 additions & 2 deletions Sources/TMDb/Models/CrewMember.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public struct CrewMember: Identifiable, Codable, Equatable, Hashable {
public let id: Int

///
/// Crew member's identifier for the particular movie or TV show.
/// Crew member's identifier for the particular movie or TV series.
///
public let creditID: String

Expand Down Expand Up @@ -47,7 +47,7 @@ public struct CrewMember: Identifiable, Codable, Equatable, Hashable {
///
/// - Parameters:
/// - id: Crew member's identifier.
/// - creditID: Crew member's identifier for the particular movie or TV show.
/// - creditID: Crew member's identifier for the particular movie or TV series.
/// - name: Crew member's name.
/// - job: Crew member's job.
/// - department: Crew member's department.
Expand Down
6 changes: 3 additions & 3 deletions Sources/TMDb/Models/ImageCollection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import Foundation
///
/// A model representing an image collection.
///
/// A collection of poster and backdrop images for a movie or TV show.
/// A collection of poster and backdrop images for a movie or TV series.
///
public struct ImageCollection: Codable, Equatable, Hashable {

///
/// Movie or TV show identifier for these images.
/// Movie or TV series identifier for these images.
///
public let id: Int

Expand All @@ -31,7 +31,7 @@ public struct ImageCollection: Codable, Equatable, Hashable {
/// Creates an image collection object.
///
/// - Parameters:
/// - id: Movie or TV show identifier for these images.
/// - id: Movie or TV series identifier for these images.
/// - posters: Poster images.
/// - backdrops: Backdrop images.
///
Expand Down
18 changes: 9 additions & 9 deletions Sources/TMDb/Models/Media.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ public enum Media: Identifiable, Codable, Equatable, Hashable {
case .movie(let movie):
return movie.id

case .tvShow(let tvShow):
return tvShow.id
case .tvSeries(let tvSeries):
return tvSeries.id

case .person(let person):
return person.id
Expand All @@ -27,9 +27,9 @@ public enum Media: Identifiable, Codable, Equatable, Hashable {
case movie(Movie)

///
/// TV show.
/// TV series.
///
case tvShow(TVShow)
case tvSeries(TVSeries)

///
/// Person.
Expand All @@ -46,7 +46,7 @@ extension Media {

private enum MediaType: String, Decodable, Equatable {
case movie
case tvShow = "tv"
case tvSeries = "tv"
case person
}

Expand All @@ -58,8 +58,8 @@ extension Media {
case .movie:
self = .movie(try Movie(from: decoder))

case .tvShow:
self = .tvShow(try TVShow(from: decoder))
case .tvSeries:
self = .tvSeries(try TVSeries(from: decoder))

case .person:
self = .person(try Person(from: decoder))
Expand All @@ -73,8 +73,8 @@ extension Media {
case .movie(let movie):
try singleContainer.encode(movie)

case .tvShow(let tvShow):
try singleContainer.encode(tvShow)
case .tvSeries(let tvSeries):
try singleContainer.encode(tvSeries)

case .person(let person):
try singleContainer.encode(person)
Expand Down
2 changes: 1 addition & 1 deletion Sources/TMDb/Models/PersonCombinedCredits.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation

///
/// A model representing combined movie and tv show credits for a person.
/// A model representing combined movie and TV series credits for a person.
///
/// A person can be both a cast member and crew member of the same show.
///
Expand Down
46 changes: 46 additions & 0 deletions Sources/TMDb/Models/PersonTVSeriesCredits.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import Foundation

///
/// A model representing a TV series credits for a person.
///
/// A person can be both a cast member and crew member of the same TV series.
///
public struct PersonTVSeriesCredits: Identifiable, Decodable, Equatable, Hashable {

///
/// Person identifier.
///
public let id: Int

///
/// TV series where the person is in the cast.
///
public let cast: [TVSeries]

///
/// TV series where the person is in the crew.
///
public let crew: [TVSeries]

///
/// All TV series the person is in.
///
public var allShows: [TVSeries] {
(cast + crew).uniqued()
}

///
/// Creates a person TV series credits object.
///
/// - Parameters:
/// - id: Person identifier.
/// - cast: TV series where the person is in the cast.
/// - crew: TV series where the person is in the crew.
///
public init(id: Int, cast: [TVSeries], crew: [TVSeries]) {
self.id = id
self.cast = cast
self.crew = crew
}

}
46 changes: 0 additions & 46 deletions Sources/TMDb/Models/PersonTVShowCredits.swift

This file was deleted.

Loading

0 comments on commit bb032f0

Please sign in to comment.