-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FEATURE] Added endpoint to seek current playback position (#73)
Added HTTP endpoint to seek playback position to specified.
- Loading branch information
1 parent
16b9dc2
commit cacea72
Showing
22 changed files
with
694 additions
and
64 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
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
26 changes: 26 additions & 0 deletions
26
src/main/java/com/odeyalo/sonata/connect/exception/InvalidSeekPositionException.java
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,26 @@ | ||
package com.odeyalo.sonata.connect.exception; | ||
|
||
public final class InvalidSeekPositionException extends PlayerCommandException { | ||
public static final String REASON_CODE = "invalid_position"; | ||
public static final String DESCRIPTION = "Invalid seek position supplied"; | ||
|
||
private InvalidSeekPositionException() { | ||
super(DESCRIPTION, REASON_CODE); | ||
} | ||
|
||
private InvalidSeekPositionException(final String message) { | ||
super(message, REASON_CODE); | ||
} | ||
|
||
private InvalidSeekPositionException(final String message, final Throwable cause) { | ||
super(message, REASON_CODE, cause); | ||
} | ||
|
||
public static InvalidSeekPositionException defaultException() { | ||
return new InvalidSeekPositionException(); | ||
} | ||
|
||
public static InvalidSeekPositionException withMessage(String message) { | ||
return new InvalidSeekPositionException(message); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/com/odeyalo/sonata/connect/exception/MissingPlayableItemException.java
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,15 @@ | ||
package com.odeyalo.sonata.connect.exception; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
|
||
public final class MissingPlayableItemException extends PlayerCommandException{ | ||
public static final String REASON_CODE = "playable_item_required"; | ||
|
||
public MissingPlayableItemException(@NotNull final String message) { | ||
super(message, REASON_CODE); | ||
} | ||
|
||
public MissingPlayableItemException(@NotNull final String message, @NotNull final Throwable cause) { | ||
super(message, REASON_CODE, cause); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/com/odeyalo/sonata/connect/exception/SeekPositionExceedDurationException.java
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,15 @@ | ||
package com.odeyalo.sonata.connect.exception; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
|
||
public final class SeekPositionExceedDurationException extends PlayerCommandException { | ||
public static final String REASON_CODE = "seek_position_exceed"; | ||
|
||
public SeekPositionExceedDurationException(@NotNull final String message) { | ||
super(message, REASON_CODE); | ||
} | ||
|
||
public SeekPositionExceedDurationException(@NotNull final String message, @NotNull final Throwable cause) { | ||
super(message, REASON_CODE, cause); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
.../java/com/odeyalo/sonata/connect/exception/UnsupportedSeekPositionPrecisionException.java
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,31 @@ | ||
package com.odeyalo.sonata.connect.exception; | ||
|
||
import lombok.EqualsAndHashCode; | ||
import lombok.Value; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
@Value | ||
@EqualsAndHashCode(callSuper = true) | ||
public class UnsupportedSeekPositionPrecisionException extends PlayerCommandException { | ||
|
||
private static final String REASON_CODE = "unsupported_precision"; | ||
private static final String DEFAULT_DESCRIPTION = "Seek position precision of received type is not supported"; | ||
|
||
private final String receivedPrecision; | ||
|
||
public UnsupportedSeekPositionPrecisionException(final String receivedPrecision) { | ||
super(DEFAULT_DESCRIPTION, REASON_CODE); | ||
this.receivedPrecision = receivedPrecision; | ||
} | ||
|
||
public UnsupportedSeekPositionPrecisionException(@NotNull final String message, | ||
@NotNull final String receivedPrecision) { | ||
super(message, REASON_CODE); | ||
this.receivedPrecision = receivedPrecision; | ||
} | ||
|
||
public UnsupportedSeekPositionPrecisionException(final String message, final String receivedPrecision, final Throwable cause) { | ||
super(message, REASON_CODE, cause); | ||
this.receivedPrecision = receivedPrecision; | ||
} | ||
} |
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
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.