Skip to content

Commit

Permalink
Trim space for languages search
Browse files Browse the repository at this point in the history
  • Loading branch information
matcornic committed Jan 31, 2016
1 parent 6bce64a commit 0bffa13
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions subtitles/languages/languages.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ type Langs []Language
// GetLanguage get the language from an id
func (l Langs) GetLanguage(id string) (lang *Language) {
for _, v := range l {
if v.ID == strings.ToLower(id) {
if strings.ToLower(strings.TrimSpace(v.ID)) == strings.ToLower(strings.TrimSpace(id)) {
return &v
}
for _, a := range v.Alias {
if a == strings.ToLower(id) {
if strings.ToLower(strings.TrimSpace(a)) == strings.ToLower(strings.TrimSpace(id)) {
return &v
}
}
Expand Down

0 comments on commit 0bffa13

Please sign in to comment.