Added arn to the main repository

This commit is contained in:
2019-06-03 18:32:43 +09:00
parent cf258573a8
commit 29a48d94a5
465 changed files with 15968 additions and 288 deletions

32
arn/AMVTitle.go Normal file
View File

@ -0,0 +1,32 @@
package arn
// AMVTitle is the same as a soundtrack title.
type AMVTitle SoundTrackTitle
// String is the default representation of the title.
func (title *AMVTitle) String() string {
return title.ByUser(nil)
}
// ByUser returns the preferred title for the given user.
func (title *AMVTitle) ByUser(user *User) string {
if user == nil {
if title.Canonical != "" {
return title.Canonical
}
return title.Native
}
switch user.Settings().TitleLanguage {
case "japanese":
if title.Native == "" {
return title.Canonical
}
return title.Native
default:
return title.ByUser(nil)
}
}