-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Repository refactor (no need to split for educational purposes)
Header files comment now shows the TechTalk title
- Loading branch information
Showing
49 changed files
with
252 additions
and
369 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
Examples/GlobantPlus/App/GlobantPlus/Application/ApplicationEnvironment.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// | ||
// Environment.swift | ||
// Premiere | ||
// GlobantPlus | ||
// | ||
// Created by Adolfo Vera Blasco on 3/1/23. | ||
// | ||
|
2 changes: 1 addition & 1 deletion
2
Examples/GlobantPlus/App/GlobantPlus/Application/GlobantPlusApp.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// | ||
// PremiereApp.swift | ||
// Premiere | ||
// GlobantPlus | ||
// | ||
// Created by Adolfo Vera Blasco on 3/1/23. | ||
// | ||
|
2 changes: 1 addition & 1 deletion
2
Examples/GlobantPlus/App/GlobantPlus/Data/Extensions/Int+Runtime.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// | ||
// Int+Runtime.swift | ||
// Premiere | ||
// GlobantPlus | ||
// | ||
// Created by Adolfo Vera Blasco on 10/3/23. | ||
// | ||
|
15 changes: 0 additions & 15 deletions
15
...tPlus/App/GlobantPlus/Data/Network/AmazonAPI/AmazonFavoriteTrainingDELETERepository.swift
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
...antPlus/App/GlobantPlus/Data/Network/AmazonAPI/AmazonFavoriteTrainingPOSTRepository.swift
This file was deleted.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
...GlobantPlus/App/GlobantPlus/Data/Network/AmazonAPI/AmazonFavoriteTrainingRepository.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// | ||
// AmazonFavoriteTrainingRepository.swift | ||
// GlobantPlus | ||
// | ||
// Created by Adolfo Vera Blasco on 15/3/23. | ||
// | ||
|
||
import Foundation | ||
import Resty | ||
|
||
final class AmazonFavoriteTrainingRepository: AmazonFavoriteTrainingBaseRepository, FavoriteTrainingRepository { | ||
func post(mediaID: Int, forUser userID: String) async throws { | ||
try await super.process(mediaID: mediaID, forUser: userID, httpMethod: .post) | ||
} | ||
|
||
func delete(mediaID: Int, forUser userID: String) async throws { | ||
try await super.process(mediaID: mediaID, forUser: userID, httpMethod: .delete) | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
Examples/GlobantPlus/App/GlobantPlus/Data/Queues/AmazonSQS/Model/SQSActivity.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// | ||
// SQSActivity.swift | ||
// Premiere | ||
// GlobantPlus | ||
// | ||
// Created by Adolfo Vera Blasco on 13/3/23. | ||
// | ||
|
2 changes: 1 addition & 1 deletion
2
Examples/GlobantPlus/App/GlobantPlus/Data/Queues/AmazonSQS/SQSActivityQueue.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// | ||
// SQSActivityQueue.swift | ||
// Premiere | ||
// GlobantPlus | ||
// | ||
// Created by Adolfo Vera Blasco on 12/3/23. | ||
// | ||
|
2 changes: 1 addition & 1 deletion
2
Examples/GlobantPlus/App/GlobantPlus/Data/Queues/AmazonSQS/Trackable.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
// | ||
// Trackable.swift | ||
// Premiere | ||
// GlobantPlus | ||
// | ||
// Created by Adolfo Vera Blasco on 13/3/23. | ||
// | ||
|
82 changes: 82 additions & 0 deletions
82
...les/GlobantPlus/App/GlobantPlus/Data/Repositories/Dashboard/TMDBDashboardRepository.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
// | ||
// TMDBPopularDocumentaryListRepository.swift | ||
// GlobantPlus | ||
// | ||
// Created by Adolfo Vera Blasco on 16/3/23. | ||
// | ||
|
||
import Foundation | ||
import MovieDB | ||
|
||
final class TMDBDashboardRepository: DashboardRepository { | ||
let apiClient: MovieDB | ||
|
||
init() { | ||
self.apiClient = MovieDB(token: ApplicationEnvironment.shared.apiToken) | ||
} | ||
|
||
func fetchPopularDocumentaries() async throws -> [TrendingItem] { | ||
let apiDocumentaries = try await apiClient.discoverDocumentaries(sortedBy: .popularity) | ||
|
||
let trendingDocumentaries = apiDocumentaries.map({ apiDocumentary in | ||
var trendingDocumentary = TrendingItem(titled: apiDocumentary.title, ofType: .tv, withIdentifier: apiDocumentary.id) | ||
|
||
trendingDocumentary.backdropPath = apiClient.makeBackdropUriFrom(path: apiDocumentary.backdropPath, ofSize: .regular) | ||
trendingDocumentary.posterPath = apiClient.makePosterUriFrom(path: apiDocumentary.posterPath, ofSize: .regular) | ||
|
||
trendingDocumentary.popularity = apiDocumentary.popularity | ||
trendingDocumentary.voteCount = apiDocumentary.voteCount | ||
trendingDocumentary.voteAverage = apiDocumentary.voteAverage | ||
trendingDocumentary.overview = apiDocumentary.overview | ||
|
||
return trendingDocumentary | ||
}) | ||
|
||
return trendingDocumentaries | ||
} | ||
|
||
func fetchTrendingMovies() async throws -> [TrendingItem] { | ||
let apiMovies = try await apiClient.trendingMovies() | ||
|
||
let trendingMovies = apiMovies.map({ apiMovie in | ||
var trendingMovie = TrendingItem(titled: apiMovie.title, ofType: .movie, withIdentifier: apiMovie.id) | ||
|
||
trendingMovie.backdropPath = apiClient.makeBackdropUriFrom(path: apiMovie.backdropPath, ofSize: .regular) | ||
trendingMovie.posterPath = apiClient.makePosterUriFrom(path: apiMovie.posterPath, ofSize: .regular) | ||
|
||
trendingMovie.popularity = apiMovie.popularity | ||
trendingMovie.voteCount = apiMovie.voteCount | ||
trendingMovie.voteAverage = apiMovie.voteAverage | ||
|
||
trendingMovie.isAdultContent = apiMovie.isAdultContent | ||
trendingMovie.overview = apiMovie.overview | ||
|
||
return trendingMovie | ||
}) | ||
|
||
return trendingMovies | ||
} | ||
|
||
func fetchTrendingShows() async throws -> [TrendingItem] { | ||
async let apiShows = apiClient.trendingShows() | ||
async let tvGenres = apiClient.genres(for: .tv) | ||
|
||
let trendingShows = try await apiShows.map({ apiShow in | ||
var trendingShow = TrendingItem(titled: apiShow.title, ofType: .tv, withIdentifier: apiShow.id) | ||
|
||
trendingShow.backdropPath = apiClient.makeBackdropUriFrom(path: apiShow.backdropPath, ofSize: .regular) | ||
trendingShow.posterPath = apiClient.makePosterUriFrom(path: apiShow.posterPath, ofSize: .regular) | ||
|
||
trendingShow.popularity = apiShow.popularity | ||
trendingShow.voteCount = apiShow.voteCount | ||
trendingShow.voteAverage = apiShow.voteAverage | ||
|
||
trendingShow.isAdultContent = apiShow.isAdultContent | ||
trendingShow.overview = apiShow.overview | ||
|
||
return trendingShow | ||
}) | ||
|
||
return trendingShows | ||
} | ||
} |
37 changes: 0 additions & 37 deletions
37
...us/App/GlobantPlus/Data/Repositories/Dashboard/TMDBPopularDocumentaryListRepository.swift
This file was deleted.
Oops, something went wrong.
39 changes: 0 additions & 39 deletions
39
...antPlus/App/GlobantPlus/Data/Repositories/Dashboard/TMDBTrendingMovieListRepository.swift
This file was deleted.
Oops, something went wrong.
40 changes: 0 additions & 40 deletions
40
...bantPlus/App/GlobantPlus/Data/Repositories/Dashboard/TMDBTrendingShowListRepository.swift
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.