# Help with custom renaming ifpremieredate & ifseason

**URL:** https://discussion.mcebuddy2x.com/t/help-with-custom-renaming-ifpremieredate-ifseason/3870
**Category:** Metadata and Renaming
**Created:** [September 11, 2020, 11:46am UTC](https://discussion.mcebuddy2x.com/t/help-with-custom-renaming-ifpremieredate-ifseason/3870 "2020-09-11T11:46:49Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![SystemIdleProcess](https://discussion.mcebuddy2x.com/user_avatar/discussion.mcebuddy2x.com/systemidleprocess/32/2560_2.png) [@SystemIdleProcess](https://discussion.mcebuddy2x.com/u/SystemIdleProcess)
#### Post date: [September 11, 2020, 11:46am UTC](https://discussion.mcebuddy2x.com/t/help-with-custom-renaming-ifpremieredate-ifseason/3870/1 "2020-09-11T11:46:49Z")

</div>

I’m trying to use the following string to rename my TV shows but it’s falling back to default.  
`%showname%%ifpremieredate%< (%premiereyear%)>\Season %ifseason%<%season%##,00>\%showname% - S%ifseason%<%season%##,00>E%episode%## - %episodename%`

Here is the error:

> ```
> INFORMATION> 2020-09-10T15:59:43 MCEBuddy.Engine.ConversionJob --> Running custom commands
> --> Custom Renaming Command -> %showname%%ifpremieredate%< (%premiereyear%)>\Season %ifseason%<%season%##,00>\%showname% - S%ifseason%<%season%##,00>E%episode%## - %episodename%
> WARNING> --> Error in file naming format detected, fallback to default naming convention.
> Error : System.IndexOutOfRangeException: Index was outside the bounds of the array.
> at MCEBuddy.MetaData.CustomRename.CustomRenameFilename(String customRenamePattern, String& newFileName, String& destinationPath, String sourceVideo, String relativeSourcePath, VideoTags metaData, Log jobLog)
> at MCEBuddy.MetaData.CustomRename.CustomRenameFilename(String customRenamePattern, String& newFileName, String& destinationPath, String sourceVideo, String relativeSourcePath, VideoTags metaData, Log jobLog)
> at MCEBuddy.MetaData.CustomRename.GetRenameByMetadata(ConversionJobOptions conversionOptions, VideoMetaData metaData, String originalFileName, String renamedFileExt, String& newFileName, String& subDestinationPath, Log jobLog)
> WARNING> --> No Season and Episode information available, using episode name/record date
> --> Custom Renaming Command -> %showname%%ifpremieredate%< (%premiereyear%)>\Season %ifseason%<%season%##,00>\%showname% - S%ifseason%<%season%##,00>E%episode%## - %episodename%
> WARNING> --> Error in file naming format detected, fallback to default naming convention.
> Error : System.IndexOutOfRangeException: Index was outside the bounds of the array.
> at MCEBuddy.MetaData.CustomRename.CustomRenameFilename(String customRenamePattern, String& newFileName, String& destinationPath, String sourceVideo, String relativeSourcePath, VideoTags metaData, Log jobLog)
> at MCEBuddy.MetaData.CustomRename.CustomRenameFilename(String customRenamePattern, String& newFileName, String& destinationPath, String sourceVideo, String relativeSourcePath, VideoTags metaData, Log jobLog)
> at MCEBuddy.MetaData.CustomRename.GetRenameByMetadata(ConversionJobOptions conversionOptions, VideoMetaData metaData, String originalFileName, String renamedFileExt, String& newFileName, String& subDestinationPath, Log jobLog)
> WARNING> --> No Season and Episode information available, using episode name/record date
> 
> ```

Here are the values detected:  
SeriesPremiereDate: 1985-05-05T00:00:00  
Season: 0  
Episode: 6

---

<div class="post-metadata">

### Author: ![SystemIdleProcess](https://discussion.mcebuddy2x.com/user_avatar/discussion.mcebuddy2x.com/systemidleprocess/32/2560_2.png) [@SystemIdleProcess](https://discussion.mcebuddy2x.com/u/SystemIdleProcess)
#### Post date: [September 11, 2020, 3:59pm UTC](https://discussion.mcebuddy2x.com/t/help-with-custom-renaming-ifpremieredate-ifseason/3870/2 "2020-09-11T15:59:30Z")

</div>

I see what I did. I was missing a comma.  
`%showname%%ifpremieredate%< (%premiereyear%) **,** >\Season %ifseason%<%season%##,00>\%showname% - S%ifseason%<%season%##,00>E%episode%## - %episodename%`

---

<div class="post-metadata">

### Author: ![Goose](https://discussion.mcebuddy2x.com/letter_avatar_proxy/v4/letter/g/5f9b8f/32.png) [@Goose](https://discussion.mcebuddy2x.com/u/Goose)
#### Post date: [September 11, 2020, 6:59pm UTC](https://discussion.mcebuddy2x.com/t/help-with-custom-renaming-ifpremieredate-ifseason/3870/3 "2020-09-11T18:59:03Z")

</div>

You can actually test your pattern within the Conversion task settings page itself. When you type in your renaming pattern, it’ll tell you if something isnt’ right or it’ll show the final template if it’s good.

![image](https://mcebuddy-discussion-forum.s3.dualstack.us-east-1.amazonaws.com/original/2X/0/08500347373c727859bafd124e9f4885dc79afa5.png)

---

<div class="post-metadata">

### Author: ![SystemIdleProcess](https://discussion.mcebuddy2x.com/user_avatar/discussion.mcebuddy2x.com/systemidleprocess/32/2560_2.png) [@SystemIdleProcess](https://discussion.mcebuddy2x.com/u/SystemIdleProcess)
#### Post date: [September 15, 2020, 11:40am UTC](https://discussion.mcebuddy2x.com/t/help-with-custom-renaming-ifpremieredate-ifseason/3870/4 "2020-09-15T11:40:24Z")

</div>

Yep, I see that now. Good looking out.
