Frontend: Change default name of new albums
Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
parent
245c8beb69
commit
fc1100ba0b
|
@ -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});
|
||||||
|
|
Loading…
Reference in a new issue