예제 #1
0
 public void Delete(StreamMedia stream)
 {
     using (connection.Lock())
     {
         connection.Delete(stream);
     }
 }
예제 #2
0
 public bool Contains(StreamMedia stream)
 {
     using (connection.Lock())
     {
         return(GetStream(stream.Path) != null);
     }
 }
예제 #3
0
 public void Insert(StreamMedia stream)
 {
     using (connection.Lock())
     {
         connection.Insert(stream);
     }
 }
예제 #4
0
 public void Update(StreamMedia stream)
 {
     using (connection.Lock())
     {
         connection.Update(stream);
     }
 }
예제 #5
0
        public Task RemoveStreamFromCollectionAndDatabase(StreamMedia stream)
        {
            var collectionStream = Streams?.FirstOrDefault(x => x.Path == stream.Path);

            if (collectionStream != null)
            {
                Streams?.Remove(collectionStream);
            }
            return(DeleteStream(stream));
        }
        public static StreamMedia GetStreamItem(VLCStorageFile file)
        {
            var video = new StreamMedia();

            video.Name     = file.Name;
            video.VlcMedia = file.Media;
            video.Path     = file.Media.mrl();

            return(video);
        }
예제 #7
0
        public async Task <StreamMedia> LoadStreamFromDatabaseOrCreateOne(string mrl)
        {
            var stream = await LoadStream(mrl);

            if (stream == null)
            {
                stream = new StreamMedia(mrl);
                await streamsDatabase.Insert(stream);
            }
            return(stream);
        }
예제 #8
0
        public override async void Execute(object parameter)
        {
            var mrl = parameter as string;

            if (string.IsNullOrEmpty(mrl))
            {
                ToastHelper.Basic("Please enter a valid URL.");
                return;
            }
            mrl = mrl.Trim();
            //TODO: pass MRL to vlc
            try
            {
                var stream = new StreamMedia(mrl);
                await Locator.MediaPlaybackViewModel.SetMedia(stream);
            }
            catch (Exception ex)
            {
                ExceptionHelper.CreateMemorizedException("PlayNetworkMRLCommand.Execute", ex);
                return;
            }
            Locator.NavigationService.Go(VLCPage.VideoPlayerPage);
            Locator.MainVM.CloseStreamFlyout();
        }
예제 #9
0
 public Task Update(StreamMedia stream)
 {
     return(streamsDatabase.Update(stream));
 }
예제 #10
0
 private Task DeleteStream(StreamMedia media)
 {
     return(streamsDatabase.Delete(media));
 }
예제 #11
0
 public async Task <bool> Contains(StreamMedia stream)
 {
     return(await Get(stream.Path) != null);
 }
예제 #12
0
        public Task Delete(StreamMedia stream)
        {
            var connection = new SQLiteAsyncConnection(DbPath);

            return(connection.DeleteAsync(stream));
        }
예제 #13
0
 public async Task Insert(StreamMedia stream)
 {
     var connection = new SQLiteAsyncConnection(DbPath);
     await connection.InsertAsync(stream);
 }