diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2011-07-08 14:00:35 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2011-07-08 14:00:35 +0300 |
commit | 3d82867917b5a5d517a0b238b7f0dbd244855dec (patch) | |
tree | 377a4754eae09ab0dba3fa931a93738079411782 /src/idop.c | |
parent | aeefe0f04e3eb45cec6cbd0ed6296ca0ea2844a6 (diff) | |
download | idest-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.c | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -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); |