@@ -104,11 +104,11 @@ public void TagIO_R_VorbisFLAC_dirtyTrackDiscNumbering()
104
104
}
105
105
106
106
[ TestMethod ]
107
- public void TagIO_RW_VorbisFLAC_multipleArtists ( )
107
+ public void TagIO_RW_VorbisFLAC_multipleArtistsCustom ( )
108
108
{
109
109
new ConsoleLogger ( ) ;
110
110
111
- string fileName = "FLAC/multiple_artists .flac" ;
111
+ string fileName = "FLAC/multiple_artists_custom .flac" ;
112
112
string location = TestUtils . GetResourceLocationRoot ( ) + fileName ;
113
113
string testFileLocation = TestUtils . CopyAsTempTestFile ( fileName ) ;
114
114
AudioDataManager theFile = new AudioDataManager ( AudioDataIOFactory . GetInstance ( ) . GetFromPath ( testFileLocation ) ) ;
@@ -122,10 +122,18 @@ public void TagIO_RW_VorbisFLAC_multipleArtists()
122
122
// Read
123
123
Assert . AreEqual ( "lovesick (feat. Punipuni Denki)" , meta . Title ) ;
124
124
Assert . AreEqual ( "Kamome Sano" + ATL . Settings . InternalValueSeparator + "Punipuni Denki" , meta . Artist ) ;
125
+ string customStuff = "" ;
126
+ meta . AdditionalFields . TryGetValue ( "CUSTOMSTUFF" , out customStuff ) ;
127
+ Assert . AreEqual ( "1" + ATL . Settings . InternalValueSeparator + "2" , customStuff ) ;
125
128
126
129
// Write same data and keep initial format
127
130
TagHolder theTag = new TagHolder ( ) ;
128
131
theTag . Artist = "Kamome Sano" + ATL . Settings . DisplayValueSeparator + "Punipuni Denki" ;
132
+ var additionalFields = new Dictionary < string , string >
133
+ {
134
+ { "CUSTOMSTUFF" , "1" + ATL . Settings . DisplayValueSeparator + "2" }
135
+ } ;
136
+ theTag . AdditionalFields = additionalFields ;
129
137
Assert . IsTrue ( theFile . UpdateTagInFileAsync ( theTag . tagData , MetaDataIOFactory . TagType . NATIVE ) . GetAwaiter ( ) . GetResult ( ) ) ;
130
138
131
139
// Check that the resulting file (working copy that has been tagged, then untagged) remains identical to the original file (i.e. no byte lost nor added)
@@ -139,6 +147,11 @@ public void TagIO_RW_VorbisFLAC_multipleArtists()
139
147
// Write and modify
140
148
theTag = new TagHolder ( ) ;
141
149
theTag . Artist = "aaa" + ATL . Settings . DisplayValueSeparator + "bbb" + ATL . Settings . DisplayValueSeparator + "ccc" ;
150
+ additionalFields = new Dictionary < string , string >
151
+ {
152
+ { "CUSTOMSTUFF" , "1" + ATL . Settings . DisplayValueSeparator + "2" + ATL . Settings . DisplayValueSeparator + "3" }
153
+ } ;
154
+ theTag . AdditionalFields = additionalFields ;
142
155
Assert . IsTrue ( theFile . UpdateTagInFileAsync ( theTag . tagData , MetaDataIOFactory . TagType . NATIVE ) . GetAwaiter ( ) . GetResult ( ) ) ;
143
156
144
157
// Read again
@@ -149,6 +162,9 @@ public void TagIO_RW_VorbisFLAC_multipleArtists()
149
162
Assert . IsTrue ( meta . Exists ) ;
150
163
151
164
Assert . AreEqual ( "aaa" + ATL . Settings . InternalValueSeparator + "bbb" + ATL . Settings . InternalValueSeparator + "ccc" , meta . Artist ) ;
165
+ customStuff = "" ;
166
+ meta . AdditionalFields . TryGetValue ( "CUSTOMSTUFF" , out customStuff ) ;
167
+ Assert . AreEqual ( "1" + ATL . Settings . InternalValueSeparator + "2" + ATL . Settings . InternalValueSeparator + "3" , customStuff ) ;
152
168
153
169
// Get rid of the working copy
154
170
if ( Settings . DeleteAfterSuccess ) File . Delete ( testFileLocation ) ;
0 commit comments