Package-level declarations

Types

Link copied to clipboard
class CachingRepository(val actualRepository: MediaRepository, requestDispatcher: CoroutineDispatcher = Dispatchers.Main) : MediaRepository

This is a meta media repository that functions as a cache. By default, NewPlayer itself does not cache anything, which is why it asks the repository for anything over and over again. If these requests are not cached your app might unnecessarily perform network requests or other IO. In order to prevent this use this media repository.

Link copied to clipboard
class DelayTestRepository(val actualRepo: MediaRepository, var delayInMS: Long) : MediaRepository

This is a meta repository implementation meant for testing. You can give it an actual repository and a delay, each request to your actual repository will then be delayed. This can be used to test a slow network.

Link copied to clipboard
interface MediaRepository

You, dear Developer who uses NewPlayer, will want to implement MediaRepository. This interface is the thing that will enable NewPlayer to access your content. Just like the ViewModel and the View, the Repository is an element of the MVVM architecture. This repository is basically the "view" to your data.

Link copied to clipboard
data class MultiRepoEntry(val key: String, val repository: MediaRepository)
Link copied to clipboard
class MultiRepository(val actualRepositories: List<MultiRepoEntry>) : MediaRepository

This repository can be used to combine multiple MediaRepositories. Be aware that the string identifying an item is extended by the key of the repository. This key is specified by MultiRepoEntry.key. The string identifying an item called item would become key:item where repo key and item are separated by a : character. You need to take care yourself to encode the item strings accordingly when you are using a MediaRepository.

Link copied to clipboard

This is a simple placeholder repository that will return no information. It can be used during development to be able to already lay out UI elements or setup and text compile NewPlayer without actually having a functioning media repository.

Link copied to clipboard
class PrefetchingRepository(val cachingRepository: MediaRepository, var disableEagerCaching: Boolean = false, val requestDispatcher: CoroutineDispatcher = Dispatchers.Main) : MediaRepository

This is a meta media repository that performs requests to all possible values of an item as soon as it gets an item it has not seen before. This can be used in combination with a caching repository to perform eager caching.