Esempio n. 1
0
 public virtual void SetWatched(bool value)
 {
     if (IsPlayable)
     {
         if (value != HaveWatched)
         {
             if (value && PlayState.PlayCount == 0)
             {
                 PlayState.PlayCount = 1;
                 //remove ourselves from the unwatched list as well
                 if (this.PhysicalParent != null)
                 {
                     this.PhysicalParent.RemoveRecentlyUnwatched(this); //thought about asynch'ing this but its a list of 20 items...
                 }
                 //don't add to watched list as we didn't really watch it (and it might just clutter up the list)
                 Application.CurrentInstance.Information.AddInformationString(string.Format(Application.CurrentInstance.StringData("SetWatchedProf"), this.Name));
             }
             else
             {
                 PlayState.PlayCount = 0;
                 //remove ourselves from the watched list as well
                 if (this.PhysicalParent != null)
                 {
                     this.PhysicalParent.RemoveNewlyWatched(this); //thought about asynch'ing this but its a list of 20 items...
                 }
                 Application.CurrentInstance.Information.AddInformationString(string.Format(Application.CurrentInstance.StringData("ClearWatchedProf"), this.Name));
             }
             PlayState.Save();
             lock (watchLock)
                 unwatchedCountCache = -1;
         }
     }
 }
        public override bool UpdatePosition(string title, long positionTicks)
        {
            Logger.ReportVerbose("Updating multi file position for " + title + " position " + positionTicks);

            if (title == null || videoFiles == null)
            {
                return(false);
            }

            int i = 0;

            foreach (var filename in videoFiles)
            {
                if (title.StartsWith(Path.GetFileNameWithoutExtension(filename)))
                {
                    PlayState.PlaylistPosition = i;
                    PlayState.PositionTicks    = positionTicks;
                    PlayState.Save();
                    return(true);
                }
                i++;
            }

            return(false);
        }
Esempio n. 3
0
        public virtual bool UpdatePosition(string title, long positionTicks)
        {
            if (PlayState == null)
            {
                return(false);
            }

            if (title.EndsWith(currentTitle) || title == alternateTitle)
            {
                if (!PlayCountIncremented && positionTicks > 0) //the first time we are called with a valid position mark us as being watched
                {
                    PlayState.PlayCount++;
                    PlayState.LastPlayed = DateTime.Now;
                    PlayCountIncremented = true;
                }
                //Logger.ReportVerbose("Updating the position for " + title + " position " + positionTicks);
                PlayState.PositionTicks = positionTicks;
                PlayState.Save();
                return(true);
            }
            else
            {
                Logger.ReportVerbose("Detaching because title doesn't match.  Current title: " + currentTitle + " Alternate Title: " + alternateTitle);
                return(false);
            }
        }
Esempio n. 4
0
 protected void MarkWatched()
 {
     if (PlayState != null)
     {
         PlayState.LastPlayed = DateTime.Now;
         PlayState.PlayCount  = PlayState.PlayCount + 1;
         PlayState.Save();
     }
 }
Esempio n. 5
0
 internal virtual void SetWatched(bool value)
 {
     if (IsPlayable)
     {
         if (value != HaveWatched)
         {
             if (value && PlayState.PlayCount == 0)
             {
                 PlayState.PlayCount = 1;
             }
             else
             {
                 PlayState.PlayCount = 0;
             }
             PlayState.Save();
             lock (watchLock)
                 unwatchedCountCache = -1;
         }
     }
 }
Esempio n. 6
0
        public virtual bool UpdatePosition(string title, long positionTicks)
        {
            Logger.ReportVerbose("Updating the position for " + title + " position " + positionTicks);

            if (PlayState == null)
            {
                return(false);
            }

            var currentTitle = Path.GetFileNameWithoutExtension(this.fileToPlay);

            if (title == currentTitle)
            {
                PlayState.PositionTicks = positionTicks;
                PlayState.Save();
                return(true);
            }
            else
            {
                return(false);
            }
        }