Page 1 of 3

new sorting option: ignore articles

Posted: 15 Nov 2011 19:58
by ladner
A new sorting option to ignore articles (the, a, an) would be very useful when managing media files like music and movies.

A quick way to turn this option on and off will be desirable so a new tool bar button may be required.

Thanks for giving this consideration.

Re: new sorting option: ignore articles

Posted: 20 Nov 2011 01:54
by serendipity
ladner wrote:A new sorting option to ignore articles (the, a, an) would be very useful when managing media files like music and movies.

A quick way to turn this option on and off will be desirable so a new tool bar button may be required.

Thanks for giving this consideration.
Hmmm, seems too much like a media manager kind of wish. Not sure how many will really use it. I for one, won't.

Re: new sorting option: ignore articles

Posted: 20 Nov 2011 08:00
by ladner
I have a great media manager however there are times when I need to work on media within the file system and ignoring articles would be helpful. Just a small suggestion to make the product better. I'm told that Directory Opus has this feature.

Re: new sorting option: ignore articles

Posted: 20 Nov 2011 17:41
by admin
This will probably remain one of the differences to DO.

Re: new sorting option: ignore articles

Posted: 25 Oct 2013 23:56
by ladner
bump

I continue to think this would be a great addition to XYP.

I am a long time heavy user of XYP and this is the only important feature I feel is missing.

I would use it on a daily basis when navigating movies and music files.

Please reconsider.

Re: new sorting option: ignore articles

Posted: 26 Oct 2013 08:56
by admin
Seems like you are alone with this wish...

Re: new sorting option: ignore articles

Posted: 26 Oct 2013 18:36
by prino
He's probably not alone, it would be nice to have, but I personally would not be using it all that much.

Re: new sorting option: ignore articles

Posted: 01 Apr 2014 18:39
by ladner
bump

The new custom columns feature in 13.90 makes it easier to manage audio and image media files. I think this is a good direction for XYplorer and I encourage you to keep going.

1) Please add the "ignore articles" feature suggested by me at the start of this thread. This would make it much more convenient to use XYplorer for managing audio and video files.

2) Please add some custom columns for video file types such as video duration, video codec, video resolution, video bit rate, audio codec, and audio bit rate.

Re: new sorting option: ignore articles

Posted: 01 Apr 2014 18:42
by admin
Easy for English, but we have 17 languages here...

Re: new sorting option: ignore articles

Posted: 01 Apr 2014 18:46
by SkyFrontier
@ladner:

1. is scripted custom column an acceptable solution?

2. if so, please provide a set of such words to ignore and I'll see what I can do.

Re: new sorting option: ignore articles

Posted: 01 Apr 2014 18:57
by admin
SkyFrontier wrote:1. is scripted custom column an acceptable solution?
Bingo, good idea!

Re: new sorting option: ignore articles

Posted: 01 Apr 2014 19:33
by Marco
SkyFrontier wrote:1. is scripted custom column an acceptable solution?
You nailed it, I was thinking about the same solution!

Re: new sorting option: ignore articles

Posted: 01 Apr 2014 20:15
by SkyFrontier
Well.

This can be achieved by two different approaches, each with flaws and strengths:

Code: Select all

   $dic = "the|a";
   $tst = gettoken(getpathcomponent(<cc_item>, base), 1, " ");
   while($tk != "") {
   $op++;
   $tk = gettoken($dic, $op, |);
   if($tst LikeI $tk) { return gettoken(getpathcomponent(<cc_item>, base), 2, " ", , 2); end 1; }
   else {  }
                    }

  return getpathcomponent(<cc_item>, base);
-potentially slower;
-can be customised at the "$dic" part (first line).

Code: Select all

   $files = gettoken(getpathcomponent(<cc_item>, base), 2, " ", , 2);
  return "$files";
-potentially faster;
-dumber: it just removes the first token from " ", returning all the rest.

Tech note: couldn't make the $dic work along with foreach loops - the list seems to return the first valid result and stuck there. :!: As stepping doesn't work for debugging CCs, it's hard to tell for sure.

Re: new sorting option: ignore articles

Posted: 01 Apr 2014 20:47
by TheQwerty
This is one place that I'd actually suggest RegexReplace...

Code: Select all

return RegexReplace(<cc_name>, '^(the|an?)\b\s+');
return ends script execution intentionally.

Re: new sorting option: ignore articles

Posted: 03 Apr 2014 21:56
by ladner
TheQwerty wrote:This is one place that I'd actually suggest RegexReplace...

Code: Select all

return RegexReplace(<cc_name>, '^(the|an?)\b\s+');
return ends script execution intentionally.
This works really well. Thanks kindly!

Gotta learn Regex some day :)

"a" and "an" are ignored as expected but "at" is not ignored. This is what I want but I am curious how it works. Can you please translate the Regex dictionary item "an?" into English for me?