Beispiel #1
0
        public string CreateAlbum(string title, string groupId)
        {
            var parametrs = new Parametr[]
            {
                new Parametr("title", title),
                new Parametr("group_id", groupId)
            };
            var xDoc = ExecuteCommand("audio.addAlbum", parametrs);

            return(xDoc.Root.Element("album_id").Value);

            ;
        }
Beispiel #2
0
        public List <Song> GetSongs(string ownerId, string albumId, string count = "1000")
        {
            if (ownerId == null)
            {
                ownerId = Id;
            }
            var parametrs = new Parametr[]
            {
                new Parametr("owner_id", ownerId),
                new Parametr("album_id", albumId),
                new Parametr("count", count)
            };
            var xDoc = ExecuteCommand("audio.get", parametrs);

            return(GetSongList(xDoc));
        }
Beispiel #3
0
        public List <AlbumVk> GetAlbums(string ownerId, string offset = "0", string count = "100")
        {
            var parametrs = new Parametr[]
            {
                new Parametr("owner_id", ownerId),
                new Parametr("offset", offset),
                new Parametr("count", count)
            };
            var xDoc   = ExecuteCommand("audio.getAlbums", parametrs);
            var albums = new List <AlbumVk>();

            albums.AddRange(from XElement child in xDoc.Descendants("album")
                            select new AlbumVk(child.Element("owner_id").Value,
                                               child.Element("album_id").Value,
                                               child.Element("title").Value));
            return(albums);
        }
Beispiel #4
0
        public string MoveToAlbum(string albumId, Song[] songs, string groupId)
        {
            var sb = new StringBuilder();

            foreach (var song in songs)
            {
                sb.Append(song.Id + ",");
            }

            var parametrs = new Parametr[]
            {
                new Parametr("album_id", albumId),
                new Parametr("group_id", groupId),
                new Parametr("audio_ids", sb.ToString())
            };
            var xDoc = ExecuteCommand("audio.moveToAlbum", parametrs);

            return(xDoc.Root.Value);
        }