This repository has been archived by the owner on Jan 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
### Describe - In Charts View, list content seems like not changing when category is changed but It's reloading - New list was appended to existing list but it should replace existing list - Because `currentPage` property is added by 1 whenever category changed, new list is considered as next list ### Changes Made Remove currentPage adding code from `requestData(category: MovieListCategory)` ```swift func requestData(category: MovieListCategory) { if currentCategory != category { currentPage = 1 } currentCategory = category fetchData(category: category) // current page += 1 } ``` ### Issues Resolved - #58 <!-- If this pull request addresses or closes any related issues, mention them here. Use the GitHub issue linking format (e.g., "Feature #123"). -->
- Loading branch information
Showing
72 changed files
with
399 additions
and
329 deletions.
There are no files selected for viewing
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,9 @@ | ||
disabled_rules: | ||
- line_length | ||
- trailing_whitespace | ||
- blanket_disable_command | ||
- unused_closure_parameter | ||
- force_try # need to enable force_try after refactoring issue 43 fixed | ||
|
||
excluded: | ||
- Pods |
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,30 @@ | ||
// | ||
// GenreModel.swift | ||
// MovieApp | ||
// | ||
// Created by Aakif Nadeem on 27/09/2023. | ||
// | ||
|
||
import Foundation | ||
|
||
let genreCode = [ | ||
28: "Action", | ||
12: "Adventure", | ||
16: "Animation", | ||
35: "Comedy", | ||
80: "Crime", | ||
99: "Documentary", | ||
18: "Drama", | ||
10751: "Family", | ||
14: "Fantasy", | ||
36: "History", | ||
27: "Horror", | ||
10402: "Music", | ||
9648: "Mystery", | ||
10749: "Romance", | ||
878: "Science Fiction", | ||
10770: "TV Movie", | ||
53: "Thriller", | ||
10752: "War", | ||
37: "Western" | ||
] |
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
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
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 |
---|---|---|
|
@@ -57,4 +57,3 @@ struct MovieListResult: Codable { | |
case voteCount = "vote_count" | ||
} | ||
} | ||
|
This file was deleted.
Oops, something went wrong.
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
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,67 @@ | ||
// | ||
// MovieAPI.swift | ||
// MovieApp | ||
// | ||
// Created by Daegeon Choi on 2023/11/22. | ||
// | ||
|
||
import Foundation | ||
|
||
extension APIService { | ||
|
||
/// Movie list | ||
static func configureUrlString(category: MovieListCategory, language: Language, page: Int) -> String { | ||
return "https://api.themoviedb.org/3/movie/\(category.key)?api_key=\(APIKey)&language=\(language.key)&page=\(page)" | ||
} | ||
|
||
/// Movie detail | ||
static func configureUrlString(id: Int, language: Language) -> String { | ||
return "https://api.themoviedb.org/3/movie/\(id)?api_key=\(APIKey)&language=\(language)" | ||
} | ||
|
||
/// Imagepath | ||
static func configureUrlString(imagePath: String?) -> String? { | ||
guard let imagePath else { return nil } | ||
return "https://image.tmdb.org/t/p/original/\(imagePath)" | ||
} | ||
|
||
/// Keyword search | ||
static func configureUrlString(keyword: String, language: Language, page: Int) -> String { | ||
return "https://api.themoviedb.org/3/search/movie?query=\(keyword)&api_key=\(APIKey)&language=\(language.key)&page=\(page)" | ||
} | ||
|
||
} | ||
|
||
// MARK: - Enumerations for API url configuration | ||
enum MovieListCategory { | ||
case popular, upcomming, topRated, nowPlaying | ||
|
||
var key: String { | ||
switch self { | ||
case .popular: return "popular" | ||
case .upcomming: return "upcomming" | ||
case .topRated: return "top_rated" | ||
case .nowPlaying: return "now_playing" | ||
} | ||
} | ||
|
||
var title: String { | ||
switch self { | ||
case .popular: return "Popular" | ||
case .upcomming: return "Upcomming" | ||
case .topRated: return "Top Rated" | ||
case .nowPlaying: return "Now Playing" | ||
} | ||
} | ||
} | ||
|
||
enum Language { | ||
case korean, english | ||
|
||
var key: String { | ||
switch self { | ||
case .korean: return "ko-KR" | ||
case .english: return "en-US" | ||
} | ||
} | ||
} |
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
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
Oops, something went wrong.