/// <summary> /// Retrieve the movie details from this record. /// </summary> /// <param name="row">SqlDataReader for the row being processed</param> /// <param name="itemlist">ArrayList of GUIListItem for storage of last added movies</param> public void OnRow_Movie(SqlDataReader row, ArrayList itemlist) { GUIListItemMovie newItem = new GUIListItemMovie(); newItem.IsFolder = true; // MyMovies uses 1 movie per folder. Files are played in alphabetical order. newItem.Label = row["title"].ToString(); newItem.Path = row["pathName"].ToString(); newItem.Plot = row["plot"].ToString(); newItem.Aspect = row["aspect"].ToString(); newItem.Certification = Certification.Rating(Convert.ToInt32(row["rating"]), Convert.ToInt32(row["country"])); newItem.CertificationCause = row["ratingCause"].ToString(); newItem.CollectionNum = Convert.ToInt32(row["collectionNum"]); newItem.ItemId = Convert.ToInt32(row["id"]); newItem.Duration = Convert.ToInt32(row["runTime"]); newItem.Year = Convert.ToInt32(row["year"]); newItem.Stars = Convert.ToInt32(row["stars"]); newItem.IsPlayed = Convert.ToBoolean(row["watched"]); newItem.Online = Convert.ToInt32(row["online"]).Equals(1); newItem.FrontCover = string.Format(@"{0}\Covers\{1}.jpg", DataPath, row["frontCover"].ToString()); newItem.BackCover = string.Format(@"{0}\Covers\{1}.jpg", DataPath, row["backCover"].ToString()); newItem.OnItemSelected += new GUIListItem.ItemSelectedHandler(OnItemSelected); newItem.OnRetrieveArt += new GUIListItem.RetrieveCoverArtHandler(newItem_OnRetrieveArt); itemlist.Add(newItem); }
/// <summary> /// Setup the required attributes for the Playing DVD and playlist. /// </summary> /// <param name="drive">The drive letter being played.</param> /// <returns>true if the drive contains a valid disk and is playing</returns> public bool OnPlayDvd(string drive) { try { if (MediaPortal.Util.Utils.getDriveType(drive) == 5) //cd or dvd drive { string videoFile = null; if (VideoDisk(drive, ref videoFile)) { GUIListItemMovie diskMovie = new GUIListItemMovie(); diskMovie.Path = videoFile; diskMovie.Label = MediaPortal.Util.Utils.GetDriveName(drive); diskMovie.ItemId = -1; // Only remember one item for actual disks. diskMovie.MountedFileName = diskMovie.Label; // Stored for resume. NowPlaying = diskMovie; AddPlayListItem(true, videoFile, diskMovie.Label); // Add the single item PlayMovieFromPlayList(true); return true; } DialogNoDisk(); } } catch (Exception ex) { Log.Error(ex); } return false; }