File tree Expand file tree Collapse file tree 4 files changed +36
-0
lines changed
Expand file tree Collapse file tree 4 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -107,6 +107,8 @@ pub const CUSTOM_GENRE: Fourcc = Fourcc(*b"\xa9gen");
107107pub const DISC_NUMBER : Fourcc = Fourcc ( * b"disk" ) ;
108108/// (`©too`)
109109pub const ENCODER : Fourcc = Fourcc ( * b"\xa9 too" ) ;
110+ /// (`©pub`)
111+ pub const PUBLISHER : Fourcc = Fourcc ( * b"\xa9 pub" ) ;
110112/// (`gnre`)
111113pub const STANDARD_GENRE : Fourcc = Fourcc ( * b"gnre" ) ;
112114/// (`©nam`)
Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ impl fmt::Display for Tag {
6161 self . format_keywords ( f) ?;
6262 self . format_copyright ( f) ?;
6363 self . format_encoder ( f) ?;
64+ self . format_publisher ( f) ?;
6465 self . format_tv_show_name ( f) ?;
6566 self . format_tv_show_name_sort_order ( f) ?;
6667 self . format_tv_network_name ( f) ?;
Original file line number Diff line number Diff line change 66"encoder" = " ©too"
77"lyrics" = " ©lyr"
88"movement" = " ©mvn"
9+ "publisher" = " ©pub"
910"title" = " ©nam"
1011"tv_episode_name" = " tven"
1112"tv_network_name" = " tvnn"
Original file line number Diff line number Diff line change @@ -164,6 +164,38 @@ impl Userdata {
164164 }
165165}
166166
167+ /// ### Publisher
168+ impl Userdata {
169+ /// Returns the publisher (`©pub`).
170+ pub fn publisher ( & self ) -> Option < & str > {
171+ self . strings_of ( & ident:: PUBLISHER ) . next ( )
172+ }
173+
174+ /// Removes and returns the publisher (`©pub`).
175+ pub fn take_publisher ( & mut self ) -> Option < String > {
176+ self . take_strings_of ( & ident:: PUBLISHER ) . next ( )
177+ }
178+
179+ /// Sets the publisher (`©pub`).
180+ pub fn set_publisher ( & mut self , publisher : impl Into < String > ) {
181+ self . set_data ( ident:: PUBLISHER , Data :: Utf8 ( publisher. into ( ) ) ) ;
182+ }
183+
184+ /// Removes the publisher (`©pub`).
185+ pub fn remove_publisher ( & mut self ) {
186+ self . remove_data_of ( & ident:: PUBLISHER ) ;
187+ }
188+
189+ /// Returns the publisher formatted in an easily readable way.
190+ #[ allow( unused) ]
191+ pub ( crate ) fn format_publisher ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
192+ match self . publisher ( ) {
193+ Some ( s) => writeln ! ( f, "publisher: {}" , s) ,
194+ None => Ok ( ( ) ) ,
195+ }
196+ }
197+ }
198+
167199/// ### Title
168200impl Userdata {
169201 /// Returns the title (`©nam`).
You can’t perform that action at this time.
0 commit comments