INTERACT FORUM

Please login or register.

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

Author Topic: How do you search by duration?  (Read 1660 times)

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4232
How do you search by duration?
« on: April 27, 2015, 04:47:51 pm »

I was attempting what I thought was a simple query earlier but couldn't get it work. I just wanted to list all films that were less than 2hrs long, once I found out that less than or equal to was =< not <= then I tried

[Duration]=<2h
[Duration]=<02:00:00
[Duration]=<120m
[Duration]=<0.08d

In the end, the only thing that worked was

[Duration]=<7200

i.e. the unit is implicitly seconds and there seems to be no human friendly formatting of that value as is available to a Date field

Is this correct? Am I missing something really obvious here?
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9143
Re: How do you search by duration?
« Reply #1 on: April 28, 2015, 12:06:04 am »

I think you are correct. To search on duration, you need to use seconds.

Your search, [Duration]=<7200 will return anything less than two hours. To get "less than or equal to" use [Duration]=<=7200

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4232
Re: How do you search by duration?
« Reply #2 on: April 28, 2015, 03:22:32 am »

That seems a particularly non programmer unfriendly approach, adding date style interpretation to this would be a sensible enhancement imv
Logged

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9143
Re: How do you search by duration?
« Reply #3 on: April 28, 2015, 11:32:01 am »

agreed.

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42389
  • Shoes gone again!
Re: How do you search by duration?
« Reply #4 on: April 28, 2015, 11:54:23 am »

I think using a d for days, h for hours, w for weeks, y for years, m for minutes and s for seconds should already work.
Logged
Matt Ashland, JRiver Media Center

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9143
Re: How do you search by duration?
« Reply #5 on: April 28, 2015, 12:05:42 pm »

Sorry Matt, but they don't. [duration]=<=2h returns "No search results" [duration]=<=7200 in the same list, returns 487 files.

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42389
  • Shoes gone again!
Re: How do you search by duration?
« Reply #6 on: April 29, 2015, 09:45:33 am »

Sorry Matt, but they don't. [duration]=<=2h returns "No search results" [duration]=<=7200 in the same list, returns 487 files.

Please test again once a new build is out.

We were flipping the less than to a greater than (and back and forth).

Your search "[duration]=<=2h" works perfectly for me with the latest code.

(Actually build 102 is out in beta now... so test away)
Logged
Matt Ashland, JRiver Media Center

marko

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 9143
Re: How do you search by duration?
« Reply #7 on: April 29, 2015, 10:41:30 am »

Confirmed. Working well now, in hours or minutes. Thank you.
Pages: [1]   Go Up