Added {mbps} binding

This commit is contained in:
Reinhard Pointner 2017-04-09 19:03:44 +08:00
parent 5a06961dfb
commit d14912fa27
2 changed files with 9 additions and 4 deletions

View File

@ -809,7 +809,12 @@ public class MediaBindingBean {
@Define("kbps")
public String getKiloBytesPerSecond() {
return String.format("%d kbps", getOverallBitRate() / 1000);
return String.format("%.0f kbps", getOverallBitRate() / 1e3f);
}
@Define("mbps")
public String getMegaBytesPerSecond() {
return String.format("%.1f Mbps", getOverallBitRate() / 1e6f);
}
@Define("khz")
@ -986,12 +991,12 @@ public class MediaBindingBean {
@Define("megabytes")
public String getFileSizeInMegaBytes() {
return String.format("%.0f", getFileSize() / Math.pow(1000, 2));
return String.format("%.0f", getFileSize() / 1e6);
}
@Define("gigabytes")
public String getFileSizeInGigaBytes() {
return String.format("%.1f", getFileSize() / Math.pow(1000, 3));
return String.format("%.1f", getFileSize() / 1e9);
}
@Define("encodedDate")

View File

@ -2,4 +2,4 @@
parameter.exclude: ^StreamKind|^UniqueID|^StreamOrder|^ID|Count$
# preview expressions (keys are tagged so they can be sorted alphabetically)
expressions: n, y, s, e, sxe, s00e00, t, d, startdate, absolute, es, sy, sc, di, dc, age, special, episode, series, primaryTitle, alias, movie, tmdbid, imdbid, pi, pn, lang, subt, plex, az, type, anime, regular, music, album, artist, albumArtist, actors, director, collection, genre, genres, languages, runtime, certification, rating, votes, vc, ac, cf, vf, hpi, af, channels, resolution, dim, width, height, bitdepth, bitrate, kbps, khz, ws, hd, source, tags, s3d, group, original, info, info.network, info.status, info.productionCompanies, info.productionCountries, info.certifications, info.certifications.AU, info.certifications.DE, omdb.rating, omdb.votes, localize.deu.n, localize.deu.t, localize.zho.n, localize.zho.t, order.airdate.sxe, order.dvd.sxe, fn, ext, mediaType, mediaPath, file, file.name, folder, folder.name, mediaTitle, audioLanguages, textLanguages, duration, seconds, minutes, hours, bytes, megabytes, gigabytes, crc32, media.title, media.collection, media.season, media.part, media.partID, media.genre, media.contentType, media.description, media.lyrics, video[0].codecID, video[0].frameRate, video[0].displayAspectRatioString, video[0].scanType, audio.language, audio[0].bitRateString, audio[0].language, text.language, text[0].language, text[0].codecInfo, camera, camera.maker, camera.model, location, location.country
expressions: n, y, s, e, sxe, s00e00, t, d, startdate, absolute, es, sy, sc, di, dc, age, special, episode, series, primaryTitle, alias, movie, tmdbid, imdbid, pi, pn, lang, subt, plex, az, type, anime, regular, music, album, artist, albumArtist, actors, director, collection, genre, genres, languages, runtime, certification, rating, votes, vc, ac, cf, vf, hpi, af, channels, resolution, dim, width, height, bitdepth, bitrate, kbps, mbps, khz, ws, hd, source, tags, s3d, group, original, info, info.network, info.status, info.productionCompanies, info.productionCountries, info.certifications, info.certifications.AU, info.certifications.DE, omdb.rating, omdb.votes, localize.deu.n, localize.deu.t, localize.zho.n, localize.zho.t, order.airdate.sxe, order.dvd.sxe, fn, ext, mediaType, mediaPath, file, file.name, folder, folder.name, mediaTitle, audioLanguages, textLanguages, duration, seconds, minutes, hours, bytes, megabytes, gigabytes, crc32, media.title, media.collection, media.season, media.part, media.partID, media.genre, media.contentType, media.description, media.lyrics, video[0].codecID, video[0].frameRate, video[0].displayAspectRatioString, video[0].scanType, audio.language, audio[0].bitRateString, audio[0].language, text.language, text[0].language, text[0].codecInfo, camera, camera.maker, camera.model, location, location.country