Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor fixes #449

Merged
merged 2 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import org.readium.r2.shared.publication.ReadingProgression as PublicationReadin
public interface VisualNavigator : Navigator {

@Deprecated(
"Moved to DirectionalNavigator",
"Renamed to OverflowableNavigator.Overflow",
level = DeprecationLevel.ERROR
)
@OptIn(ExperimentalReadiumApi::class)
Expand Down Expand Up @@ -126,7 +126,7 @@ public interface VisualNavigator : Navigator {
* Moves to the next content portion (eg. page) in the reading progression direction.
*/
@Deprecated(
"Moved to DirectionalNavigator",
"Moved to OverflowableNavigator",
level = DeprecationLevel.ERROR
)
public fun goForward(animated: Boolean = false, completion: () -> Unit = {}): Boolean
Expand All @@ -135,7 +135,7 @@ public interface VisualNavigator : Navigator {
* Moves to the previous content portion (eg. page) in the reading progression direction.
*/
@Deprecated(
"Moved to DirectionalNavigator",
"Moved to OverflowableNavigator",
level = DeprecationLevel.ERROR
)
public fun goBackward(animated: Boolean = false, completion: () -> Unit = {}): Boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,15 +208,15 @@ public class MediaSessionNavigator(
return go(locator, animated, completion)
}

public fun goForward(animated: Boolean, completion: () -> Unit): Boolean {
public fun goForward(animated: Boolean = true, completion: () -> Unit = {}): Boolean {
if (!isActive) return false

seekRelative(skipForwardInterval)
completion()
return true
}

public fun goBackward(animated: Boolean, completion: () -> Unit): Boolean {
public fun goBackward(animated: Boolean = true, completion: () -> Unit = {}): Boolean {
if (!isActive) return false

seekRelative(-skipBackwardInterval)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,17 @@ public class ForegroundDownloadManager(
}

private suspend fun doRequest(request: DownloadManager.Request, id: DownloadManager.RequestId) {
val destination = withContext(Dispatchers.IO) {
File.createTempFile(UUID.randomUUID().toString(), null, downloadsDirectory)
val destination: File
try {
destination = withContext(Dispatchers.IO) {
File.createTempFile(UUID.randomUUID().toString(), null, downloadsDirectory)
}
} catch (exception: IOException) {
val error = DownloadManager.DownloadError.FileSystem(FileSystemError.IO(exception))
forEachListener(id) {
onDownloadFailed(id, error)
}
return
}

httpClient
Expand Down