Esempio n. 1
0
        public static VideoScreenlist GetVideoScreenlist(VideoRecord _record)
        {
            var screenlist = new VideoScreenlist(_record);

            using (var command = new SQLiteCommand())
            {
                command.CommandText = "Select [Id], [Vid], [Screenlist] From [VideoScreenlists] Where [Deleted] = 0 and [Vid] = @vid;";
                command.Parameters.Add(new SQLiteParameter("@vid")
                {
                    DbType = DbType.String, Value = _record.Vid
                });

                using (var reader = accesser.ExecuteReader(command))
                {
                    if (!reader.HasRows)
                    {
                        return(screenlist);
                    }
                    else
                    {
                        reader.Read();
                        screenlist.Id         = reader.GetInt32(0);
                        screenlist.Vid        = reader.GetString(1);
                        screenlist.Screenlist = reader.GetBitmap(2);
                    }
                }
            }

            return(screenlist);
        }
Esempio n. 2
0
        public static VideoTagCollection GetVideoTags(VideoRecord _record)
        {
            var tags = new VideoTagCollection();

            using (var command = new SQLiteCommand())
            {
                command.CommandText = "Select [Id], [Vid], [Text], [Intensity] From [VideoTags] Where [Deleted] = 0 and [Vid] = @vid;";
                command.Parameters.Add(new SQLiteParameter("@vid")
                {
                    DbType = DbType.String, Value = _record.Vid
                });

                using (var reader = accesser.ExecuteReader(command))
                {
                    if (!reader.HasRows)
                    {
                        return(tags);
                    }

                    while (reader.Read())
                    {
                        VideoTag tag = new VideoTag(_record);

                        tag.Id        = reader.GetInt32(0);
                        tag.Vid       = reader.GetString(1);
                        tag.Text      = reader.GetString(2);
                        tag.Intensity = reader.GetIntensity(3);

                        tags.Add(tag);
                    }
                }
            }

            return(tags);
        }
Esempio n. 3
0
        public static VideoRecordCollection GetVideoRecords(VideoSeries _series)
        {
            var records = new VideoRecordCollection();

            using (var command = new SQLiteCommand())
            {
                command.CommandText = "Select [Vid],[File_Path],[File_Name],[File_Extention],[File_Size],[Alias],[Alt_Alias],[Series],[Alt_Series],[Icon],[Score],[Favorite],[Duration],[Intensity],[Last_playback],[Format],[Resolution],[Checksum],[Inserted] From [VideoRecords] Where [Deleted] = 0 and [Series] = @series;";
                command.Parameters.Add(new SQLiteParameter("@series")
                {
                    DbType = DbType.String, Value = _series.Series
                });

                using (var reader = accesser.ExecuteReader(command))
                {
                    if (!reader.HasRows)
                    {
                        return(records);
                    }

                    while (reader.Read())
                    {
                        VideoRecord record = new VideoRecord();

                        record.Vid            = reader.GetString(0);
                        record.File_Path      = reader.GetString(1);
                        record.File_Name      = reader.GetString(2);
                        record.File_Extention = reader.GetString(3);
                        record.File_Size      = reader.GetInt64(4);
                        record.Alias          = reader.GetString(5);
                        record.Alt_Alias      = reader.GetNullableString(6);
                        record.Series         = reader.GetString(7);
                        record.Alt_Series     = reader.GetNullableString(8);
                        record.Icon           = reader.GetBitmap(9);
                        record.Score          = reader.GetInt32(10);
                        record.Favorite       = reader.GetBoolean(11);
                        record.Duration       = reader.GetTimeSpan(12);
                        record.Intensity      = reader.GetNullableString(13);
                        record.Last_playback  = reader.GetDateTime(14);
                        record.Format         = reader.GetNullableString(15);
                        record.Resolution     = reader.GetNullableString(16);
                        record.Checksum       = reader.GetNullableString(17);
                        record.Inserted       = reader.GetDateTime(18);

                        records.Add(record);
                    }
                }
            }

            return(records);
        }
Esempio n. 4
0
        public static bool CheckIfInPlaylist(VideoRecord _videoRecord)
        {
            using (var command = new SQLiteCommand())
            {
                command.CommandText = "Select [Pid] From [VideoPlaylist] Where [Vid] = @vid Limit 1;";
                command.Parameters.Add(new SQLiteParameter("@vid")
                {
                    DbType = DbType.String, Value = _videoRecord.Vid
                });

                using (var reader = accesser.ExecuteReader(command))
                {
                    if (reader.HasRows)
                    {
                        return(true);
                    }
                    else
                    {
                        return(false);
                    }
                }
            }
        }
Esempio n. 5
0
 public VideoScreenlist(VideoRecord _record)
 {
     this.VideoRecord = _record;
 }
Esempio n. 6
0
 public VideoTag(VideoRecord _record)
 {
     this.VideoRecord = _record;
 }