INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: I think I found a bug, Or help I am baffeled :-)  (Read 2194 times)

666JackTheKnife666

  • World Citizen
  • ***
  • Posts: 150
I think I found a bug, Or help I am baffeled :-)
« on: September 07, 2012, 08:49:57 pm »

I have several custom fields for tagging my audio books.

Book Author = text field
Book Series = text field
Book Series Volume = text but is a number like 1
Book Title= text field
Display Book Title = calculated field

*Display Book Title* is a field that uses the other fields to make a pretty title for example if it's not a part of a series it will only use the book title field but if it's part of a series it uses book title, book series, and the book series volume field.
example  no series : See Spot Run
example series : See Spot Run - Spots adventures - Book 1

Here is the Display Book Title expression
If(IsEqual([Media Sub Type],Audiobook),If(IsEqual([Book Series],),[Book Title],[Book Title] - [Book Series] Book [Book Series Volume]),)


The problem I am having is in the file rename move & copy tool with the expression for the file name

If(IsEqual([Media Sub Type],Audiobook),PadNumber([Track #],3) - [Display Book Title],If(IsEqual(Left([Name], 1),0),[Name] - [My Album Title],PadNumber([Track #],3) - [Name] - [My Album Title]))

In this case the book I am tagging is a non series book
the calculated value of the display book title field is "The Return Of Moriarty"
The file name I am getting as a product in the rename move & copy tool is as follows

011 - The Return Of Moriarty - unknown book series book unknown book series volume.mp3

In the file name expression I don't use the book series field or the book series volume field at all.  I would appreciate any and all help figuring out what is going on here. I have been using this expression for years with out a problem, I did just upgrade to the latest MC17 .185 tho so possibly a bug ?
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9139
Re: I think I found a bug, Or help I am baffeled :-)
« Reply #1 on: September 08, 2012, 02:00:05 am »

It's this bit here, from the "Display" field:
Quote
If(IsEqual([Book Series],),[Book Title],[Book Title] - [Book Series] Book [Book Series Volume])

Rename move and copy won't allow empty values as Windows does not like folders without names, So, the rename tool converts empty values to "Unknown [field name]", then runs the expression, giving you unexpected results because now, as far as the expression evaluator is concerned, [Book Series] is not empty.

A slight tweak on the "Display" field expression should take care of this:
If(IsEqual([Media Sub Type],Audiobook),If(IsEqual([Book Series,0],),[Book Title],[Book Title] - [Book Series] Book [Book Series Volume]),)

The "Zero" instructs the evaluator to use the raw field data and should take care of your issue.

-marko

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: I think I found a bug, Or help I am baffeled :-)
« Reply #2 on: September 08, 2012, 02:03:59 am »

There were some changes that caused fields to be evaluated differently in the Rename dialog.  To avoid this, use the raw field output designator instead of the default mode which outputs values such as "unknown".  This is done using the form: [field,0].  I've rewritten your calculated field in this form, and simplified a bit:

IfElse(IsEqual([Media Sub Type],Audiobook),[Book Title]IfElse(!IsEmpty([Book Series,0]), / - [Book Series] Book [Book Series Volume]))

We're testing using IsEmpty against the raw expansion of the [Book Series] field, instead of IsEqual against a null value.
Logged
The opinions I express represent my own folly.

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9139
Re: I think I found a bug, Or help I am baffeled :-)
« Reply #3 on: September 08, 2012, 02:33:02 am »

Beat ya by three minutes!! That doesn't happen too often :)

I'm off cycling this morning, with my daughter and granddaughter, and possibly, Sir Chris Hoy!! I've not ridden a bicycle in many years... wish me luck!!

-marko

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: I think I found a bug, Or help I am baffeled :-)
« Reply #4 on: September 08, 2012, 02:35:27 am »

Have a good ride!  But no gloating to the youngsters please.
Logged
The opinions I express represent my own folly.

666JackTheKnife666

  • World Citizen
  • ***
  • Posts: 150
Re: I think I found a bug, Or help I am baffeled :-)
« Reply #5 on: September 08, 2012, 10:52:17 pm »

Gentlemen, the solution you provided does indeed work thank you so vary much!!
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9139
Cycling was fun
« Reply #6 on: September 10, 2012, 01:38:23 am »

Gentlemen, the solution you provided does indeed work thank you so vary much!!
Sweet, thanks for taking the time to say so :)

Have a good ride!  But no gloating to the youngsters please.
Had a great time. Many, many years ago, I cycled everywhere, often disappearing for days at a time on my bike. Doing that on Saturday made feel like I was twenty again! Was good fun, seriously thinking of buying myself a bike and taking it up again. The mind is certainly up for it, we'll see how the body votes, the jury is still out at the moment!!
As for gloating, no, none of that, a bit of personal chuckling and head shaking going on though... I mean seriously, do these guys in their dayglo lycra and strange headgear look in the mirror before thay leave home? :D ;) :)

-marko

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Cycling was fun
« Reply #7 on: September 10, 2012, 07:11:10 pm »

I mean seriously, do these guys in their dayglo lycra and strange headgear look in the mirror before they leave home? :D ;) :)

Guilty as charged.

Logged
The opinions I express represent my own folly.
Pages: [1]   Go Up