View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0019347 | MMW 5 | Tagging / organizing (properties / auto-tools) | public | 2022-09-02 20:27 | 2022-11-02 18:24 |
Reporter | peke | Assigned To | |||
Priority | high | Severity | feature | Reproducibility | N/A |
Status | closed | Resolution | reopened | ||
Target Version | 5.0.4 | Fixed in Version | 5.0.4 | ||
Summary | 0019347: Masks: Add ability to get the POS and LAST position of String within String | ||||
Description | In masks there should be a way to Add ability to get the POS of String within String eg. $pos(string,what) = $pos(<Album>, :) -> Album: "Original Motion Picture Soundtrack: Footloose" = 35 $last(string,what) = $pos(<Album>,oo) -> Album: "Original Motion Picture Soundtrack: Footloose" = 42 It will be very useful along with $len(string) | ||||
Additional Information | https://www.mediamonkey.com/forum/viewtopic.php?t=102546 | ||||
Tags | No tags attached. | ||||
Fixed in build | 2675 | ||||
|
From what I see here: https://www.mediamonkey.com/forum/viewtopic.php?t=102546 user is rather asking for something like $CutBefore(string,what) i.e. tracked in 0019346:0069166 |
|
Assigned back to me as the $POS will be needed to find whether a character/substring is part of the string at all. e.g. $if( $pos(:,<album>) > 0, $Trim($RightFrom(<album>, :)), <album>) |
|
Fixed in 5.0.4.2662 |
|
Not sure what exactly has been implemented here but $pos() always returns 0. Used $pos(<Album>,:) on an Album with : |
|
As per my example above it is $pos(what, string) -- > not $pos(string, what) i.e. use $pos(:,<album>) instead |
|
Verified 2663 |
|
Why is it $pos(what, string) not $pos(string, what), it seems that goes counter to all other methods available. |
|
OK, it was because e.g. in Delphi/Pascal the pos is defined as Pos(const SubStr, Str) But you are right that for consistency with mask functions in MM it's better to exchange the params, so exchanged to $pos(string, what) in build 2674 |
|
On 2764: 1 $pos(<album>, :) gives length of Album + 1 instead of expected : position (space is allowed in other masks) 2 $pos(<album> , :) gives length of Album + 2 instead, but $pos(<album> ,:) works |
|
Good catch. => Fixed in 2675 |
|
Confirmed on 2675. |