Exemple #1
0
        public E <LocalStr> Delete(string listId)
        {
            lock (ioLock) {
                var id   = ToRealId(listId);
                var file = IdToFile(id);
                if (!playlistCache.Remove(id) && !file.Exists)
                {
                    return(new LocalStr(strings.error_playlist_not_found));
                }

                return(DeleteFile(file));
            }
        }
Exemple #2
0
        public E <LocalStr> DeletePlaylist(string listId)
        {
            var checkName = Util.IsSafeFileName(listId);

            if (!checkName.Ok)
            {
                return(checkName.Error);
            }

            if (!database.Remove(listId))
            {
                return(new LocalStr($"Failed to delete list {listId}"));
            }
            resourceSearch?.Rebuild();
            return(R.Ok);
        }