Closed ghost closed 2 years ago
I also wanted to add as a general note, that I'm essentially looking for 3 pieces of information in the search results. Even some direction as to whether I could do this myself would be appreciated!
Hi ghost. Thanks for the feedback!
Regarding the MediaPageableList, when you're iterating through the results, each element is a Media enum. Therefore you could do something like:
switch media {
case .movie(let movie):
// It's a movie!
case .tvShow(let tvShow):
// It's a TV Show
case .person(let person):
// It's a Person
}
Hey!
Just wanted to start by saying I appreciate this library! I was actually making all the requests I needed myself, but once I ran into this, I figured I could switch over as this seems like a much better implementation than what I had going. I just had a question regarding using the search feature.
My specific use case requires searching movies and shows simultaneously by using the
searchAll(..)
method withinSearchService
. This seems to give a mix of results from TMDb with a generic media type.I'm trying to figure out how I can decipher whether the
Media
that gets returned in theMediaPageableList
is aMovie
orTVShow
. Even just knowing whether the ID property inMedia
is for aMovie
orTVShow
would suffice.Is there any way to currently do this? Am I possible approaching this incorrectly or missing something? I would appreciate any help or insight on this!
P.S. I want to avoid searching movies and shows separately since the TMDb endpoint for searching all will return a list of content for what's more relevant whether that's movies, shows, or even people.