-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTorrent.cs
182 lines (173 loc) · 4.95 KB
/
Torrent.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace CSL
{
public class Torrent
{
/*Main music information*/
public string artist = null;
public string album = null;
public string albumType = null;
public string bitrate = null;
public string year = null;
public string physicalFormat = null;
public string bitFormat = null;
/*Torrent file information*/
public string path;
public string fileName;
public string birth; //Waffles | What.CD
public string destPath;
public bool discard;
/*Information[] will hold all values that the user wishes to use for
* directory structure output. It is split up as follows:
* **Information[0-10] -- Music information**
*
* information[0] --> Artist
* information[1] --> Album
* information[2] --> AlbumType
* information[3] --> bitrate
* information[4] --> year
* information[5] --> physical format (CD,DVD,VINYL,WEB)
* information[6] --> bit format (MP3,FLAC)
*
* **Information[10-20] -- File Information**
*
* information[10] --> path
* information[11] --> file name
* information[12] --> birth
* information[13] --> destination path
* information[14] --> discard
* */
public Torrent() { }
public Torrent(string[] information)
{
if (information.Length >= 13)
{
artist = information[0];
album = information[1];
albumType = information[2];
bitrate = information[3];
year = information[4];
physicalFormat = information[5];
bitFormat = information[6];
/*Torrent file information*/
path = information[10];
fileName = information[11];
birth = information[12];
destPath = information[13];
discard = (information[14] == "true") ? true : false;
}
}
public string[] GetInformation()
{
string[] information = new string[20];
information[0] = artist;
information[1] = album ;
information[2] = albumType ;
information[3] = bitrate ;
information[4] = year ;
information[5] = physicalFormat ;
information[6] = bitFormat ;
information[10] = path;
information[11] = fileName;
information[12] = birth;
information[13] = destPath;
information[14] = (discard == true) ? "true" : "false";
return information;
}
#region Get Methods
public string GetArtist()
{
return this.artist;
}
public string GetAlbum ()
{
return this.album;
}
public string GetYear()
{
return this.year;
}
public string GetAlbumType()
{
return this.albumType;
}
public string GetBitrate()
{
return this.bitrate;
}
public string GetBitFormat()
{
return this.bitFormat;
}
public string GetPhysicalFormat()
{
return this.physicalFormat;
}
public string GetPath()
{
return this.path;
}
public string GetFileName()
{
return this.fileName;
}
public string GetBirth()
{
return this.birth;
}
public string GetDestinationPath()
{
return this.destPath;
}
public bool GetDiscard()
{
return discard;
}
#endregion
#region Set Methods
public void SetPath(string path)
{
this.path = path;
}
public void SetArtist(string artist)
{
this.artist = artist;
}
public void SetAlbum(string album)
{
this.album = album;
}
public void SetYear(string year)
{
this.year = year;
}
public void SetAlbumType(string albumType)
{
this.albumType = albumType;
}
public void SetBitrate(string bitrate)
{
this.bitrate = bitrate;
}
public void SetBitFormat(string bitformat)
{
this.bitFormat = bitformat;
}
public void SetPhysicalFormat(string physicalformat)
{
this.physicalFormat = physicalformat;
}
public void SetDestinationPath(string destpath)
{
this.destPath = destpath;
}
public void SetDiscard(bool value)
{
this.discard = value;
}
#endregion
}
}