IPB

Welcome Guest ( Log In | Register )

> foobar2000 General Forum Rules

This is NOT a tech support forum.
Tech support questions go to foobar2000 Tech Support forum instead.

See also: Hydrogenaudio Terms of Service.

new view via ›Preferences: Album List‹ won't work as it should, construction of $substring-$strstr give wrong output
nonsinn
post Jan 30 2013, 18:29
Post #1





Group: Members
Posts: 3
Joined: 30-January 13
Member No.: 106296



Hi all,
hope this post is in the right part of this forum.

Problem: I tried to create a new Album List, but the output isn't what i want sad.gif

Hard facts:
  • every cd saved as one wave (PCM)
  • using cue-sheet
  • can't store %cd%-value


Here what i wanna do (so it should be easy to follow what I wanna do…):
CODE
if album artist
    then if %album artist% = various
        ⇒ sort like %sub-a%
        else if %album artist% ≠ various
        ⇒ sort like %sub-b% with %album artist%
    else if %artist%
        ⇒ sort like %sub-b% with %artist%

%sub-a%
    %album artist% ( ≙ various) |$left(%album%,7)|%date% - %album%,30 - (max. 30 letter and add [if they include »cd OR vol.«] all information between nearest '(' and ')')
for example: with original %album% = rock s'cool (a spanking good song collection) (vol.01 cd2)
⇒ various | rock s' | 2007 - rock s' cool (a - (vol.001 cd1)

%sub-b%
    first letter of %artist% (or %album artist%) | %artist% (or %album artist%)|%date% - %album%,30 - (max. 30 letter and add [if they include »cd OR vol.«] all information between nearest '(' and ')')
for example: with original %album% = the beginning (cd1) [deluxe 2cd edition]
⇒ b | black eyed peas the | 2010 - the beginning ( - (cd1)
for example: with original %album% = complete works (cd08) mazurkas (vol.02) [cor de groot, artur moreira, sofia philharmonic orchestra, dimiter manolov]
⇒ c | chopin | ~1830 - complete works  - (cd08)(vol.02)


so i wrote the following code (after hours and some tries and errors)
CODE
$ifequal($replace($meta(album artist),various,99999),99999,%album artist%|[$left(%album%,7)]|[$left(%date%,4) - ][$ifgreater($len(%album%),30,$left(%album%,15) $substr($meta(album),$strstr($meta(album),'('cd),$add($strstr($meta(album),'('cd),5)),%album%)]|[#%track% - ][%artist% - ][%title%],$if($meta(album artist),$left(%album artist%,1)|%album artist%|[$left(%date%,4) - ][$ifgreater($len(%album%),30,$left(%album%,15)  $substr($meta(album),$strstr($meta(album),'('cd),$add($strstr($meta(album),'('cd),5)),%album%)]|[#%track% - ][%title%],$if(%artist%,$left(%artist%,1))|%artist%|[$left(%date%,4) - ][$ifgreater($len(%album%),30,$left(%album%,15)  $substr($meta(album),$strstr($meta(album),'('cd),$add($strstr($meta(album),'('cd),5)),%album%)]|[#%track% - ][%title%]))


Here the problems:
  1. How to get the stings (… cd …) and (… vol …) or (… cd … vol …) or (… vol … cd …) more precise?
  2. Why adds foobar the first five letters to an $left15-string without (cd)?

Any ideas how I can get what I want? All the other stuff works at the moment as it should, therefore I would be happy if someone able to help.

With best regards,
nonsinn
Go to the top of the page
+Quote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 25th October 2014 - 17:53