Backend: Code clean-up and small improvements

Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
Michael Mayer 2020-06-01 12:08:08 +02:00
parent cd54bbe7ae
commit 973911fabf
6 changed files with 57 additions and 36 deletions

View file

@ -158,7 +158,6 @@ func ImportWorker(jobs <-chan ImportJob) {
log.Infof("import: %s related %s file %s", res, f.FileType(), txt.Quote(f.RelativeName(ind.originalsPath())))
}
}
}
}

View file

@ -11,7 +11,6 @@ import (
"github.com/ulule/deepcopier"
)
// PhotoResult contains found photos and their main file plus other meta data.
type PhotoResult struct {
ID uint `json:"-"`

View file

@ -31,7 +31,7 @@ func IsHex(s string) bool {
}
for _, r := range s {
if (r < 48 || r > 57) && (r < 97 || r > 102) && (r < 65 || r > 90) && r != 45{
if (r < 48 || r > 57) && (r < 97 || r > 102) && (r < 65 || r > 90) && r != 45 {
return false
}
}

View file

@ -11,39 +11,60 @@ import (
var FileTitleRegexp = regexp.MustCompile("[\\p{L}\\-]{2,}")
var SpecialWords = map[string]string{
"nyc": "NYC",
"ny": "NY",
"uae": "UAE",
"usa": "USA",
"amd": "AMD",
"tiff": "TIFF",
"ibm": "IBM",
"usd": "USD",
"gbp": "GBP",
"chf": "CHF",
"ceo": "CEO",
"cto": "CTO",
"cfo": "CFO",
"cia": "CIA ",
"fbi": "FBI",
"bnd": "BND",
"fsb": "FSB",
"nsa": "NSA",
"lax": "LAX",
"sfx": "SFX",
"ber": "BER",
"sfo": "SFO",
"lh": "LH",
"lhr": "LHR",
"afl": "AFL",
"nrl": "NRL",
"nsw": "NSW",
"qld": "QLD",
"vic": "VIC",
"iphone": "iPhone",
"imac": "iMac",
"ipad": "iPad",
"macbook": "MacBook",
"nyc": "NYC",
"ny": "NY",
"uae": "UAE",
"usa": "USA",
"amd": "AMD",
"tiff": "TIFF",
"ibm": "IBM",
"usd": "USD",
"gbp": "GBP",
"chf": "CHF",
"ceo": "CEO",
"cto": "CTO",
"cfo": "CFO",
"cia": "CIA ",
"fbi": "FBI",
"bnd": "BND",
"fsb": "FSB",
"nsa": "NSA",
"lax": "LAX",
"sfx": "SFX",
"ber": "BER",
"sfo": "SFO",
"lh": "LH",
"lhr": "LHR",
"afl": "AFL",
"nrl": "NRL",
"nsw": "NSW",
"qld": "QLD",
"vic": "VIC",
"iphone": "iPhone",
"imac": "iMac",
"ipad": "iPad",
"macbook": "MacBook",
"gelaende": "Gelände",
"schwaebisch": "Schwäbisch",
"schwaebische": "Schwäbische",
"aegypten": "Ägypten",
"muenchen": "München",
"wuerttemberg": "Württemberg",
"baden-wuerttemberg": "Baden-Württemberg",
"nuernberg": "Nürnberg",
"wuerzburg": "Würzburg",
"tubingen": "Tübingen",
"tuebingen": "Tübingen",
"koeln": "Köln",
"oesterreich": "Österreich",
"woerthersee": "Wörthersee",
"oeland": "Öland",
"schoenefeld": "Schönefeld",
"duesseldorf": "Düsseldorf",
"dusseldorf": "Düsseldorf",
"saarbrucken": "Saarbrücken",
"saarbruecken": "Saarbrücken",
"zuerich": "Zürich",
}
var SmallWords = map[string]bool{

View file

@ -108,6 +108,7 @@ var Countries = map[string]string{
"greifswald": "de",
"dresden": "de",
"nürnberg": "de",
"würzburg": "de",
"munich": "de",
"frankfurt": "de",
"brandenburg": "de",

View file

@ -104,6 +104,7 @@ DE:Schwerin
DE:Greifswald
DE:Dresden
DE:Nürnberg
DE:Würzburg
DE:Munich
DE:Frankfurt
DE:Brandenburg