Added {az} SortInitial binding.

This commit is contained in:
Reinhard Pointner 2016-01-26 11:29:16 +00:00
parent d38980ee75
commit db9dc0f9e9
3 changed files with 25 additions and 1 deletions

View File

@ -133,6 +133,21 @@ public class ExpressionFormatMethods {
return compile("^(The|A|An)\\s(.+)", CASE_INSENSITIVE).matcher(self).replaceFirst(replacement).trim(); return compile("^(The|A|An)\\s(.+)", CASE_INSENSITIVE).matcher(self).replaceFirst(replacement).trim();
} }
public static String sortInitial(String self) {
// use primary initial, ignore The XY, A XY, etc
String s = ascii(sortName(self)).toUpperCase();
int c = s.codePointAt(0);
if (Character.isDigit(c)) {
return "0-9";
}
if (Character.isLetter(c)) {
return String.valueOf(Character.toChars(c));
}
return null;
}
/** /**
* Get acronym, i.e. first letter of each word. * Get acronym, i.e. first letter of each word.
* *

View File

@ -610,6 +610,15 @@ public class MediaBindingBean {
return createMapBindings(new PropertyBindings(metaInfo, null)); return createMapBindings(new PropertyBindings(metaInfo, null));
} }
@Define("az")
public String getSortInitial() {
try {
return sortInitial(getCollection().toString());
} catch (Exception e) {
return sortInitial(getName());
}
}
@Define("episodelist") @Define("episodelist")
public Object getEpisodeList() throws Exception { public Object getEpisodeList() throws Exception {
return WebServices.getEpisodeListProvider(getSeriesInfo().getDatabase()).getEpisodeList(getSeriesInfo().getId(), SortOrder.forName(getSeriesInfo().getOrder()), new Locale(getSeriesInfo().getLanguage())); return WebServices.getEpisodeListProvider(getSeriesInfo().getDatabase()).getEpisodeList(getSeriesInfo().getId(), SortOrder.forName(getSeriesInfo().getOrder()), new Locale(getSeriesInfo().getLanguage()));

View File

@ -2,4 +2,4 @@
parameter.exclude: ^StreamKind|Count$ parameter.exclude: ^StreamKind|Count$
# preview expressions (keys are tagged so they can be sorted alphabetically) # preview expressions (keys are tagged so they can be sorted alphabetically)
expressions: n,y,s,e,es,sxe,s00e00,t,d,startdate,absolute,special,episode,series,primaryTitle,alias,movie,tmdbid,imdbid,music,artist,albumArtist,album,pi,pn,lang,actors,director,collection,genre,genres,certification,rating,vc,ac,cf,vf,hpi,af,resolution,dim,ws,sdhd,source,tags,s3d,group,original,fn,ext,mediaType,file,file.name,folder,folder.name,gigabytes,crc32,info,info.runtime,info.status,omdb.rating,omdb.votes,localize.German.title,age,duration,seconds,minutes,media,media.title,media.overallBitRateString,video,video.codecID,video.frameRate,video.displayAspectRatioString,video.scanType,audio,audio.bitRateString,audio.language,audios,audios.language,text,text.codecInfo,text.language,texts,texts.language expressions: n,y,s,e,es,sxe,s00e00,t,d,startdate,absolute,special,episode,series,primaryTitle,alias,movie,tmdbid,imdbid,az,music,artist,albumArtist,album,pi,pn,lang,actors,director,collection,genre,genres,certification,rating,vc,ac,cf,vf,hpi,af,resolution,dim,ws,sdhd,source,tags,s3d,group,original,fn,ext,mediaType,file,file.name,folder,folder.name,gigabytes,crc32,info,info.runtime,info.status,omdb.rating,omdb.votes,localize.German.title,age,duration,seconds,minutes,media,media.title,media.overallBitRateString,video,video.codecID,video.frameRate,video.displayAspectRatioString,video.scanType,audio,audio.bitRateString,audio.language,audios,audios.language,text,text.codecInfo,text.language,texts,texts.language