Frontend: Change default name of new albums

Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
Michael Mayer 2019-12-21 17:08:40 +01:00
parent 245c8beb69
commit fc1100ba0b

View file

@ -290,9 +290,8 @@
let name = DateTime.local().toFormat("LLLL yyyy"); let name = DateTime.local().toFormat("LLLL yyyy");
if(this.results.findIndex(a => a.AlbumName.startsWith(name)) !== -1) { if(this.results.findIndex(a => a.AlbumName.startsWith(name)) !== -1) {
name = this.$gettext("New Album");
const existing = this.results.filter(a => a.AlbumName.startsWith(name)); const existing = this.results.filter(a => a.AlbumName.startsWith(name));
name += " " + Util.arabicToRoman(existing.length) name = `${name} (${existing.length + 1})`
} }
const album = new Album({"AlbumName": name}); const album = new Album({"AlbumName": name});