Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
geloczi committed Dec 19, 2021
1 parent 9bd8820 commit fde0f93
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public async Task ListArtistAlbumSongs()
(SongQueryParameter.artist, Config.TestArtist),
(SongQueryParameter.album_artist, Config.TestArtist),
(SongQueryParameter.album, Config.TestAlbum),
(SongQueryParameter.sort_by, SongSortBy.track),
(SongQueryParameter.sort_by, SongSortBy.Track),
(SongQueryParameter.sort_direction, SortDirection.Descending));
Assert.IsTrue(response.Success);
Assert.IsTrue(response.Data.Songs.Length >= 2);
Expand All @@ -196,7 +196,7 @@ public async Task ListArtistAlbumSongs()
(SongQueryParameter.artist, Config.TestArtist),
(SongQueryParameter.album_artist, Config.TestArtist),
(SongQueryParameter.album, Config.TestAlbum),
(SongQueryParameter.sort_by, SongSortBy.track),
(SongQueryParameter.sort_by, SongSortBy.Track),
(SongQueryParameter.sort_direction, SortDirection.Ascending)
).Result;
foreach (var song in response.Data.Songs)
Expand Down
34 changes: 1 addition & 33 deletions SynologyDotNet.AudioStation/Model/Song.cs
Original file line number Diff line number Diff line change
@@ -1,39 +1,7 @@
using System;
using Newtonsoft.Json;
using Newtonsoft.Json;

namespace SynologyDotNet.AudioStation.Model
{
[Flags]
public enum SongQueryAdditional : short
{
None = 0,
song_tag = 1,
song_audio = 2,
song_rating = 4,
All = ~None
}

public enum SongQueryParameter
{
id,
artist,
album_artist,
album,
sort_by,
sort_direction
}

public static class SongSortBy
{
public const string title = "title";
public const string song_rating = "song_rating";
public const string album = "album";
public const string album_artist = "album_artist";
public const string year = "year";
public const string track = "track";
public const string random = "random";
}

public class Song
{
/// <summary>
Expand Down
14 changes: 14 additions & 0 deletions SynologyDotNet.AudioStation/Model/SongQueryAdditional.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System;

namespace SynologyDotNet.AudioStation.Model
{
[Flags]
public enum SongQueryAdditional : short
{
None = 0,
song_tag = 1,
song_audio = 2,
song_rating = 4,
All = ~None
}
}
12 changes: 12 additions & 0 deletions SynologyDotNet.AudioStation/Model/SongQueryParameter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
namespace SynologyDotNet.AudioStation.Model
{
public enum SongQueryParameter
{
id,
artist,
album_artist,
album,
sort_by,
sort_direction
}
}
13 changes: 13 additions & 0 deletions SynologyDotNet.AudioStation/Model/SongSortBy.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
namespace SynologyDotNet.AudioStation.Model
{
public static class SongSortBy
{
public const string Title = "title";
public const string Rating = "song_rating";
public const string Album = "album";
public const string AlbumArtist = "album_artist";
public const string Year = "year";
public const string Track = "track";
public const string Random = "random";
}
}

0 comments on commit fde0f93

Please sign in to comment.