# Bulk import cover arts

**URL:** https://community.mp3tag.de/t/bulk-import-cover-arts/16432
**Category:** General Discussion
**Created:** [December 20, 2014, 11:19am UTC](https://community.mp3tag.de/t/bulk-import-cover-arts/16432 "2014-12-20T11:19:04Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![mihalv](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/bc8723/32.png) [@mihalv](https://community.mp3tag.de/u/mihalv)
#### Post date: [December 20, 2014, 11:19am UTC](https://community.mp3tag.de/t/bulk-import-cover-arts/16432/1 "2014-12-20T11:19:04Z")

</div>

Hello. I have a lot of files with similar name structure:

**title.tvepisode\_date.ext**

and the same number of covers (their names are equivalent to **tvepisode.jpg** ).

How to import right covers for files based on the part of filename?

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [December 20, 2014, 12:11pm UTC](https://community.mp3tag.de/t/bulk-import-cover-arts/16432/2 "2014-12-20T12:11:17Z")

</div>

Using the filename is not the optimum approach.  
If you have a structure in the filename then you should first convey that structure to tag fields and import the data into the fields.  
e.g.  
Convert\>Filename-Tag  
%title%.%TVEPISODE%\_%dummy%

Then use an action of the type "Import cover from file" and enter as filename:  
%TVEPISODE%.jpg

---

<div class="post-metadata">

### Author: ![mihalv](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/bc8723/32.png) [@mihalv](https://community.mp3tag.de/u/mihalv)
#### Post date: [December 22, 2014, 8:05pm UTC](https://community.mp3tag.de/t/bulk-import-cover-arts/16432/3 "2014-12-22T20:05:51Z")

</div>

Thanks. Please help with following. I have files with name structure: Artist\_Publisher\_Episode\_Date.ext

'Episode' sometimes = Unknown Episode

I try to write 'title' tag like this:

%artist% (%publisher% / $if(%episode%="Unknown Episode",%date%,%episode%))

What's wrong here? mp3tag always writes %date%.

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [December 22, 2014, 8:11pm UTC](https://community.mp3tag.de/t/bulk-import-cover-arts/16432/4 "2014-12-22T20:11:43Z")

</div>

There is not really a field called DATE. Some players/taggers create this.  
The only fields that carry date information are YEAR or RELEASETIME.

It its not quite clear how you get a TITLE from the filename.

Edit: I had to think a little - could it be that the syntax for $IF is wrong? If you want to compare 2 strings then you have to issue a $eql() statement:  
$if($eql(%episode%,'Unknown Episode'),%date%,%episode%)  
It is not possible to use the = as comparison operator.

---

<div class="post-metadata">

### Author: ![mihalv](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/bc8723/32.png) [@mihalv](https://community.mp3tag.de/u/mihalv)
#### Post date: [December 22, 2014, 8:22pm UTC](https://community.mp3tag.de/t/bulk-import-cover-arts/16432/5 "2014-12-22T20:22:17Z")

</div>

> [@ohrenkino](#):
>
> There is not really a field called DATE. Some players/taggers create this.  
> The only fields that carry date information are YEAR or RELEASETIME.
> 
> It its not quite clear how you get a TITLE from the filename.

I get tags %date%, %episode%, %artist% and %publisher% from filename at first of course. mp3tag extracts these tags correctly, inc. %date%.

The problem is somewhere in syntax I think.

If I use %artist% (%publisher% / $if(%episode%="Unknown Episode",%date%,%episode%)) mp3tag always writes %date% ...

if I use %artist% (%publisher% / $if(%episode%\<\>"Unknown Episode",%episode%,%date%)) it always writes %episode% regardless of episode name (even it is Unknown Episode).

---

<div class="post-metadata">

### Author: ![ohrenkino](https://community.mp3tag.de/user_avatar/community.mp3tag.de/ohrenkino/32/4843_2.png) [@ohrenkino](https://community.mp3tag.de/u/ohrenkino)
#### Post date: [December 22, 2014, 8:24pm UTC](https://community.mp3tag.de/t/bulk-import-cover-arts/16432/6 "2014-12-22T20:24:27Z")

</div>

> [@mihalv](#):
>
> ...  
> The problem is somewhere in syntax I think.  
> ...

That is what I gathered after I thought a little. Please see the edit of my previous post.

---

<div class="post-metadata">

### Author: ![mihalv](https://community.mp3tag.de/letter_avatar_proxy/v4/letter/m/bc8723/32.png) [@mihalv](https://community.mp3tag.de/u/mihalv)
#### Post date: [December 22, 2014, 8:28pm UTC](https://community.mp3tag.de/t/bulk-import-cover-arts/16432/7 "2014-12-22T20:28:46Z")

</div>

> [@ohrenkino](#):
>
> That is what I gathered after I thought a little. Please see the edit of my previous post.

Thanks. It works ok now!
