Skip to content

Commit

Permalink
Merge pull request #3 from ryukinix/perfect-match
Browse files Browse the repository at this point in the history
Add perfect match selection to anilist_app.go
  • Loading branch information
aQaTL authored Jun 7, 2020
2 parents 5745129 + a767dc1 commit b18d11f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions anilist_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,10 @@ func alSelectEntry(ctx *cli.Context) error {
var matchedEntry *anilist.MediaListEntry = nil
for i, entry := range al.List {
title := entry.Title.Romaji + " " + entry.Title.English + " " + entry.Title.Native
if strings.ToLower(entry.Title.UserPreferred) == searchTerm {
matchedEntry = &al.List[i]
break
}
if strings.Contains(strings.ToLower(title), searchTerm) {
if matchedEntry != nil {
matchedEntry = nil
Expand Down

0 comments on commit b18d11f

Please sign in to comment.