Saving artwork to a separate directory?

Tags: #<Tag:0x00007fd2a5f3ba90> #<Tag:0x00007fd2a5f3b950>

Hello, I have a renaming script that will move files to structures like so:

Artist/
  Single disc release title/
    01. Track.ext
    02. Track.ext
    ...
    front.jpg
    back.jpg
Artist/
  Multi disc release title/
    Disc 01. Disc subtitle/
      01. Track.ext
      02. Track.ext
      ...
      front.jpg
      back.jpg
    Disc 02. Disc subtitle/
      01. Track.ext
      02. Track.ext
      ...
      front.jpg
      back.jpg

Is there a way that I can tell Picard to save cover art to directory away from the audio files, thus forgoing all the duplicate files, from the renaming script? To illustrate, ideal end result:

Artist/
  Single disc album/
    Artwork/
      front.jpg
      back.jpg
    01. Track.ext
    02. Track.ext
    ...
    front.jpg <-- bonus if a copy the Front image can, additionally, be saved WITH the audio files.
Artist/
  Multi disc release/
    Artwork/
      front.jpg
      back.jpg
    Disc 01. Disc subtitle/
      01. Track.ext
      02. Track.ext
      ...
      front.jpg
    Disc 02. Disc subtitle/
      01. Track.ext
      02. Track.ext
      ...
      front.jpg

Is there something I can throw in, in front of the if block I use to determine if a release is multi-disc? Really not sure how to handle images.

Edit: So I don’t think there are any variables I can use to say, if this put images here. The only image related variables I can find are coverart_maintype, coverart_types, and coverart_comment.

Am I right in thinking that the Cover Art tab in the options is the only place I can tell Picard to do something with images, and that any path will always be relative to the file being read? Maybe I can suss something out.

Here’s my rename script anyway:

$noop(
	Replace ... with …
)
$set(title,$replace(%title%,...,…))
$set(album,$replace(%album%,...,…))
$set(discsubtitle,$replace(%discsubtitle%,...,…))

$if(%discsubtitle%,$set(~id3:TXXX:discsubtitle,%discsubtitle%))

$noop(
	Organise files by filetype.
	$upper(%_extension%)/
)

$noop(
	Organise files under Album Artist
)
%albumartist%/

$noop(
	Organise promotional releases away from official releases
)
$if($in(%releasestatus%,promo),
	Promotional/
)

$noop(
	Organise release types
)
$if(%_secondaryreleasetype%,
	$title(%_secondaryreleasetype%),
	$if($lt($len(%_primaryreleasetype%),3),
		$upper(%_primaryreleasetype%),
		$title(%_primaryreleasetype%)
	)
)/

$noop(
	Format release main directory
)
%originalyear% - 
%albumartist% — 
%album% 
\(
$if(%date%,%date%,missing-date)
$if(%label%,
	$if($not($in(%label%,
		[no label])),\, 
		%label%
	),
)
\) 

$noop(
	Include information on release format
)
\(
$if($lt(%totaldiscs%,2),
	$noop(
		Single disc
	)
	$if($in(%media%,Digital),
		Digital$if($gt(%_bits_per_sample%,16), @ %_bits_per_sample%bit,)$if($gt(%_sample_rate%,44100), $div(%_sample_rate%,1000)kHz,)$if(%_releasecomment%, • %_releasecomment%,),
		%media%\, 
	),
	$noop(
		Multi disc
	)
	$if($in(%media%,Digital),
		Digital$if($gt(%_bits_per_sample%,16), @ %_bits_per_sample%bit,)$if($gt(%_sample_rate%,44100), $div(%_sample_rate%,1000)kHz,)$if(%_releasecomment%, • %_releasecomment%,),
		$if($is_complete(),
			$if($if(%media%,CD),
				%totaldiscs%×%media%\, ,
				%media%\, 
			),
			%media%\, 
		)
	)
)

$noop(
	Where was release issued?
)
$if($not($in(%media%,Digital)),
	$if($in(%releasecountry%,XW),
		Worldwide,
		$if($in(%releasecountry%,XE),
			Europe,%releasecountry%)))
\) 

$noop(
	If there is a cat number, include it at the end of the main release directory name
)
$if(%catalognumber%,[$upper(%catalognumber%)],)/

$noop(
	Sort discs into subdirectories
)
$if($is_complete(),
	$noop(
		If is complete
        Helps deal with releases where the end disc(s) are DVDs etc, and not present in sorted files.
	)
	$if($gte(%totaldiscs%,2),
		$noop(
			Prepend release format to folder, if format not digital
		)
		$if($not($in(%media%,Digital)),
			%media% ,
		)
	)
	$if($gte(%totaldiscs%,2),
		$pad(%discnumber%,2,0). ,)
	$if($gte(%totaldiscs%,2),
		$if(%discsubtitle%,
			%discsubtitle%/,
			%album%/
		)
	),
	$noop(
		If is incomplete
	)
	$if($gte(%totaldiscs%,3),
		$noop(
			Prepend release format to folder, if format not digital
		)
		$if($not($in(%media%,Digital)),
			%media% ,
		)
	)
	$if($gte(%totaldiscs%,3),
		$pad(%discnumber%,2,0). ,)
	$if($gte(%totaldiscs%,3),
		$if(%discsubtitle%,
			%discsubtitle%/,
			%album%/
		)
	)
)

$noop(
	Use vinyl numbering, if it applies.
	disc-track. title.ext
)
$if($is_complete(),
	$if($in(%media%,Vinyl),
		%_musicbrainz_tracknumber%,
		$if($gte(%totaldiscs%,2),
			$pad(%discnumber%,2,0)-,)
	$pad(%tracknumber%,2,0)
	). %title%,
	$if($in(%media%,Vinyl),
		%_musicbrainz_tracknumber%,
		$if($gt(%totaldiscs%,2),
			$pad(%discnumber%,2,0)-,
		)
		$pad(%tracknumber%,2,0)
	). %title%
)

This in the file name field in the Cover Art tab in the options gets me most of the way there. What it doesn’t do is copy the front image to the directory with the audio files.

$if($is_complete(),
	$noop(
		Complete release
		Useful for releases where the final discs are DVD/BluRay and not present on disk.
	)
	$if($gte(%totaldiscs%,2),
		../Artwork/%coverart_maintype%$if(%coverart_comment%,_%coverart_comment%,),
		Artwork/%coverart_maintype%$if(%coverart_comment%,_%coverart_comment%,)
	),
	$noop(
		Incomplete release
	)
	$if($gte(%totaldiscs%,3),
		../Artwork/%coverart_maintype%$if(%coverart_comment%,_%coverart_comment%,),
		Artwork/%coverart_maintype%$if(%coverart_comment%,_%coverart_comment%,)
	)
)