Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Commit

Permalink
add .fail() to 4Anime files
Browse files Browse the repository at this point in the history
  • Loading branch information
ExuApplePie committed Jan 28, 2022
1 parent 9e753fc commit 2aab5fc
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import SwiftSoup

extension NASourceFourAnime {
func anime(from link: AnimeLink) -> NineAnimatorPromise<Anime> {
.fail(.contentUnavailableError("4Anime is no longer available on NineAnimator"))/*
(self.isAnimeLink(url: link.link) ? .success(link) : self.resolveAnimeLink(
from: link.link,
artworkUrl: link.image
Expand Down Expand Up @@ -146,6 +147,6 @@ extension NASourceFourAnime {

/// Checks if the provided link points to an anime page
private func isAnimeLink(url: URL) -> Bool {
url.pathComponents.contains("anime")
url.pathComponents.contains("anime")*/
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,17 @@ import Foundation
import NineAnimatorCommon
import SwiftSoup

extension NASourceFourAnime {
extension NASourceFourAnime {/*
/// 4anime provides multiple links for each episode, however they are not shown to the user
static let knownServers = [
"server1": "Server 1",
"server2": "Server 2",
"server3": "Server 3",
"server4": "Server 4"
]
]*/

func episode(from link: EpisodeLink, with anime: Anime) -> NineAnimatorPromise<Episode> {
.fail(.contentUnavailableError("4Anime is no longer available on NineAnimator"))/*
NineAnimatorPromise.firstly {
try URL(string: link.identifier).tryUnwrap()
} .thenPromise {
Expand Down Expand Up @@ -144,6 +145,6 @@ extension NASourceFourAnime {
]
]
)
}
}*/
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import SwiftSoup

extension NASourceFourAnime {
func featured() -> NineAnimatorPromise<FeaturedContainer> {
.fail(.contentUnavailableError("4Anime is no longer available on NineAnimator"))
/*
requestManager.request("/", handling: .browsing).responseString.then {
responseContent in
let endpointURL = self.endpointURL
Expand Down Expand Up @@ -82,6 +84,6 @@ extension NASourceFourAnime {
featured: popularAnimeLinks,
latest: recentAnimeLinks
)
}
}*/
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ extension NASourceFourAnime {
)

func link(from url: URL) -> NineAnimatorPromise<AnyLink> {
.fail()/*
NineAnimatorPromise<URL>.firstly {
let urlString = url.absoluteString

Expand Down Expand Up @@ -64,6 +65,6 @@ extension NASourceFourAnime {
image: animeArtworkUrl,
source: self
))
}
}*/
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
// You should have received a copy of the GNU General Public License
// along with NineAnimator. If not, see <http://www.gnu.org/licenses/>.
//

/*
import Foundation
import Kingfisher
import NineAnimatorCommon
Expand All @@ -35,3 +35,4 @@ extension NASourceFourAnime: Kingfisher.ImageDownloadRequestModifier {
return modifiedRequest
}
}
*/
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ extension NASourceFourAnime {
page == 0 ? _results?.map { .anime($0) } ?? [] : []
}

func more() {
func more() { /*
if performingTask == nil {
performingTask = parent.requestManager.request(
url: self.encodedW3CQueryUrl,
Expand Down Expand Up @@ -99,7 +99,7 @@ extension NASourceFourAnime {
self._results = $0
self.delegate?.pageIncoming(0, from: self)
}
}
}*/
}

private var encodedW3CQueryUrl: URL {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,12 @@ class NASourceFourAnime: BaseSource, Source, PromiseSource {
super.init(with: parent)

// Setup Kingfisher request modifier
setupGlobalRequestModifier()
// setupGlobalRequestModifier()
}

func suggestProvider(episode: Episode, forServer server: Anime.ServerIdentifier, withServerName name: String) -> VideoProviderParser? {
NASourceFourAnime.knownServers.keys.contains(server)
? DummyParser.registeredInstance : nil
}
DummyParser.registeredInstance
}

override func recommendServer(for anime: Anime) -> Anime.ServerIdentifier? {
recommendServers(for: anime, ofPurpose: .playback).first
Expand Down

0 comments on commit 2aab5fc

Please sign in to comment.