Skip to content

Commit ce092ce

Browse files
Update tests to ensure color metadata is unaffected
I only use the color tags in Ableton for VSTs, so it hadn't occurred to me that this could pop up in sample metadata as well!
1 parent b1ae320 commit ce092ce

5 files changed

Lines changed: 20 additions & 8 deletions

File tree

livemeta/src/folder.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,6 @@ impl FolderMetadata {
163163
}
164164

165165
/// Deletes a keyword from an item in the document.
166-
///
167-
/// This will not remove the item itself, even if all the keywords are gone -
168-
/// while keywords are currently the only metadata stored for each file,
169-
/// Ableton could potentially add additional data in future versions.
170166
pub fn delete_keyword(&mut self, item: &ItemSelector, i: usize) -> Result {
171167
self.xmp
172168
.delete_array_item(ABLETON_NS, &item.keywords.value, i as i32)?;
@@ -177,10 +173,6 @@ impl FolderMetadata {
177173
}
178174

179175
/// Deletes all keywords from an item in the document.
180-
///
181-
/// This will not remove the item itself - while keywords are currently the
182-
/// only metadata stored for each file, Ableton could potentially add
183-
/// additional data in future versions.
184176
pub fn delete_keywords(&mut self, item: &ItemSelector) -> Result {
185177
self.xmp.delete_property(ABLETON_NS, &item.keywords.value)?;
186178

src/test_data/initial.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
<rdf:Bag>
1111
<rdf:li rdf:parseType="Resource">
1212
<ablFR:filePath>bd1.wav</ablFR:filePath>
13+
<ablFR:colors>
14+
<rdf:Bag>
15+
<rdf:li>1</rdf:li>
16+
</rdf:Bag>
17+
</ablFR:colors>
1318
<ablFR:keywords>
1419
<rdf:Bag>
1520
<rdf:li>Drums|Kick</rdf:li>

src/test_data/tags_added.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
<rdf:Bag>
1111
<rdf:li rdf:parseType="Resource">
1212
<ablFR:filePath>bd1.wav</ablFR:filePath>
13+
<ablFR:colors>
14+
<rdf:Bag>
15+
<rdf:li>1</rdf:li>
16+
</rdf:Bag>
17+
</ablFR:colors>
1318
<ablFR:keywords>
1419
<rdf:Bag>
1520
<rdf:li>Drums|Kick</rdf:li>

src/test_data/tags_removed.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
<rdf:Bag>
1111
<rdf:li rdf:parseType="Resource">
1212
<ablFR:filePath>bd1.wav</ablFR:filePath>
13+
<ablFR:colors>
14+
<rdf:Bag>
15+
<rdf:li>1</rdf:li>
16+
</rdf:Bag>
17+
</ablFR:colors>
1318
<ablFR:keywords>
1419
<rdf:Bag>
1520
<rdf:li>Drums|Kick</rdf:li>

src/test_data/tags_removed_all.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
<rdf:Bag>
1111
<rdf:li rdf:parseType="Resource">
1212
<ablFR:filePath>bd1.wav</ablFR:filePath>
13+
<ablFR:colors>
14+
<rdf:Bag>
15+
<rdf:li>1</rdf:li>
16+
</rdf:Bag>
17+
</ablFR:colors>
1318
</rdf:li>
1419
<rdf:li rdf:parseType="Resource">
1520
<ablFR:filePath>bd2.wav</ablFR:filePath>

0 commit comments

Comments
 (0)