public void UpdateCurrentItemPlayTime() { //TODO: Don't use SelectedItem? What if selection is changed while process is still running? //Only log time if the session lasted more than 5 minutes if (CurrentProcess.RunTime != null && CurrentProcess.RunTime.TotalMinutes > 5) { //The above IF should prevent DateTime.Now actually being used so this is fine DateTime startTime = CurrentProcess.TimeStarted ?? DateTime.Now; DateTime endTime = CurrentProcess.TimeLastPolled ?? DateTime.Now; SelectedItem.AddPlayTime(startTime, endTime); LibraryFiler.SaveLibraryData(); } }
// CONSTRUCTORS public MainViewModel() { //TODO: Scan directory asynchronously LibraryFiler.ScanDirectory(); List <LibraryCollection> FullCollectionList = LibraryFiler.AllCollections; CollectionList = new List <LibraryCollection>(); //Hide empty collections foreach (LibraryCollection collection in FullCollectionList) { IEnumerable <LibraryItem> collectionItems = LibraryFiler.FullLibraryList.Where(x => x.MatchesCollection(collection) && x.IsVisible); if (collection.IsVisible && collectionItems.Count() > 0) { CollectionList.Add(collection); } } }
public void SaveGameRunSettings() { //Save settings to file LibraryFiler.SetRunSettings(ConsolesList); }
public void UpdateLibraryFile() { SelectedItem.Tags = GetInputTags(); LibraryFiler.SaveLibraryData(); }