api call SetWatchedTimes failing for dvd rip
- Dominant language
- Java
- Stars
- 287
- Forks
- 172
- PR merge metrics
- No merged PRs in 30d
Description
The SetWatchedTimes call is not setting the watched time for a dvd. It is working for a recording.
Below is extracted from a test using sagex
public static void main(String args[]) throws Exception
{
int mediaID = 7130249; // I feel pretty
testSetAiringTime(mediaID, 300);
mediaID = 7354220; // Chesapeake Shores
testSetAiringTime(mediaID, 300);
}
public static void testSetAiringTime(int mediaID, int secondsWatched)
{
Object mediafile = MediaFileAPI.GetMediaFileForID(mediaID);
Object airing = MediaFileAPI.GetMediaFileAiring(mediafile);
AiringAPI.ClearWatched(airing);
AiringAPI.SetWatchedTimes(airing, AiringAPI.GetAiringStartTime(airing) + secondsWatched * 1000, 1534948850L * 1000L);
System.out.println("media Title = "+ MediaFileAPI.GetMediaTitle(airing) + " IsDVD: " +
MediaFileAPI.IsDVD(airing));
long watchedDuration = AiringAPI.GetWatchedDuration(airing);
long watchedEndTime = AiringAPI.GetWatchedEndTime(airing);
long realWatchedStartTime = AiringAPI.GetRealWatchedStartTime(airing);
long startTime = AiringAPI.GetAiringStartTime(airing);
long sageSecondsWatched = watchedDuration / 1000L;
System.out.println("watchedDuration: " + watchedDuration);
System.out.println("watchedEndTime: " + watchedEndTime);
System.out.println("realWatchedStartTime: " + realWatchedStartTime);
System.out.println("startTime: " + startTime);
System.out.println("sageSecondsWatched: " + sageSecondsWatched);
if (Math.abs(sageSecondsWatched - secondsWatched) <= 3)
{
System.out.println("Sage shows watched time set to the desired time.");
}
else
{
System.out.println("Sage does not show watched time was set to the desired time!");
}
}
Contributor guide
Assessment
This issue has not been assessed yet.