aboutsummaryrefslogtreecommitdiff
path: root/src/idop.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2011-07-08 14:00:35 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2011-07-08 14:00:35 +0300
commit3d82867917b5a5d517a0b238b7f0dbd244855dec (patch)
tree377a4754eae09ab0dba3fa931a93738079411782 /src/idop.c
parentaeefe0f04e3eb45cec6cbd0ed6296ca0ea2844a6 (diff)
downloadidest-3d82867917b5a5d517a0b238b7f0dbd244855dec.tar.gz
idest-3d82867917b5a5d517a0b238b7f0dbd244855dec.tar.bz2
Add a possibility to delete a subset of ID3 frames.
* NEWS: Document changes to --delete. * doc/idest.texi: Likewise. * src/cmdline.opt: --delete takes optional argument. -d is a shorthand for it. * src/idop.c (del_tags): Delete only certain frames, if a frame list is given.
Diffstat (limited to 'src/idop.c')
-rw-r--r--src/idop.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/idop.c b/src/idop.c
index c953836..79f9491 100644
--- a/src/idop.c
+++ b/src/idop.c
@@ -165,3 +165,19 @@ del_tags(const char *name)
abort(); /* FIXME */
- id3_tag_clearframes(tag);
+ if (ed_list) {
+ gl_list_iterator_t itr;
+ const void *p;
+
+ itr = gl_list_iterator(ed_list);
+ while (gl_list_iterator_next(&itr, &p, NULL)) {
+ const struct ed_item *item = p;
+ struct id3_frame *frame;
+
+ while (frame = id3_tag_findframe(tag, item->id, 0)) {
+ id3_tag_detachframe(tag, frame);
+ id3_frame_delete(frame);
+ }
+ }
+ gl_list_iterator_free(&itr);
+ } else
+ id3_tag_clearframes(tag);
safe_id3_file_update_and_close(file);

Return to:

Send suggestions and report system problems to the System administrator.