[PATCH] Re: atomicparsley tagging issue

dinkypumpkin dinkypumpkin at gmail.com
Sat Apr 2 11:38:53 EDT 2011


On 2 Apr 2011, at 09:02, Jimmy Aitken wrote:

> There is a version of AtomicParsley which tags the 'longDescription'
> field.  I have a modified version of AtomicParsley which allows this
> and have a small patch which allows this tag to be added if the
> version supports it.  Here's the patch to allow it.  Line numbers may
> vary due to the other patches I've added recently.
> 
> --- get_iplayer.orig	2011-04-02 08:59:43.000000000 +0100
> +++ get_iplayer	2011-04-02 08:59:11.000000000 +0100
> @@ -4384,6 +4384,12 @@
> 				push @cmd, "--album", $prog->{name};
> 			}
> 
> +			# Check to see if AtomicParsley has been modified to allow full description
> +			my $atomic_log = `$bin->{atomicparsley} /dev/null --longDescription 2>&1`;
> +			if ( $atomic_log =~ /requires an argument/ ) {
> +				push @cmd, '--longDescription', $tags->{desc};
> +			}
> +
> 			# Add the thumbnail if one was downloaded
> 			push @cmd, "--artwork", $prog->{thumbfile} if -f $prog->{thumbfile};

For iTunes users, the "long description" atom will be sort of hidden away, so not so useful.  Are there other media managers/players that make more use of that atom?  For a more easily viewable (and editable) presentation of the long description in iTunes, use the "--lyrics" arg to atomicparsley.  It should be available in all versions, and can be used alongside "--longDescription".

That said, a couple of notes on the patch above:  There is at least one version of atomicparsley that uses "--longdesc" instead of "--longDescription".  I think long description support postdates the time when the original developers quit working on atomicparsley, so has been done ad hoc.  Also, the above code is Linux/OSX-only since /dev/null isn't known on Windows (where the equivalent is NUL).  However, below is another suggestion for handling "--longDescription" in a more generic manner.  The line numbers reflect that the patch is against Shevek's M4A code, but falls outside his changes, so it should be easy enough to paste it into the released version as well.

--- a/get_iplayer
+++ b/get_iplayer
@@ -53,6 +53,7 @@ use Env qw[@PATH];
 use Fcntl;
 use File::Copy;
 use File::Path;
+use File::Spec;
 use File::stat;
 use Getopt::Long;
 use HTML::Entities;
@@ -4366,6 +4367,20 @@ sub tag_file {
 			# Add the thumbnail if one was downloaded
 			push @cmd, "--artwork", $prog->{thumbfile} if -f $prog->{thumbfile};
 
+			# Add long description if supported by atomicparsley
+			my $devnull = File::Spec->devnull();
+			my $longDescriptionOpt;
+			foreach my $opt ("--longDescription", "--longdesc") {
+				my $atomic_log = `atomicparsley $devnull $opt 2>&1`;
+				if ( $atomic_log =~ /requires an argument/ ) {
+					$longDescriptionOpt = $opt;
+					last;
+				}
+			}
+			if ($longDescriptionOpt) {
+				push @cmd, $longDescriptionOpt, $tags->{desc};
+			}
+
 			# time of recording - this messes up iTunes somewhat
 			#push @cmd, "--purchaseDate", "$prog->{dldate}T$prog->{dltime}Z" if $prog->{dldate} && $prog->{dltime};




More information about the get_iplayer mailing list