-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #111 from samicemalone/show-progress
Update show progress endpoints to provide the last episode watched/collected
- Loading branch information
Showing
5 changed files
with
88 additions
and
2 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
35 changes: 35 additions & 0 deletions
35
src/main/java/com/uwetrottmann/trakt5/enums/ProgressLastActivity.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,35 @@ | ||
package com.uwetrottmann.trakt5.enums; | ||
|
||
import java.util.HashMap; | ||
import java.util.Locale; | ||
import java.util.Map; | ||
|
||
public enum ProgressLastActivity implements TraktEnum { | ||
|
||
COLLECTED("collected"), | ||
WATCHED("watched"); | ||
|
||
private final String value; | ||
|
||
ProgressLastActivity(String value) { | ||
this.value = value; | ||
} | ||
|
||
private static final Map<String, ProgressLastActivity> STRING_MAPPING = new HashMap<>(); | ||
|
||
static { | ||
for (ProgressLastActivity via : ProgressLastActivity.values()) { | ||
STRING_MAPPING.put(via.toString().toUpperCase(Locale.ROOT), via); | ||
} | ||
} | ||
|
||
public static ProgressLastActivity fromValue(String value) { | ||
return STRING_MAPPING.get(value.toUpperCase(Locale.ROOT)); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return value; | ||
} | ||
|
||
} |
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