mirror of
https://github.com/navidrome/navidrome.git
synced 2025-05-30 07:09:29 +03:00
Renamed method
This commit is contained in:
parent
19de3e6a3c
commit
27b47abfe0
@ -157,7 +157,7 @@ func (s *ItunesScanner) fullPath(pID string) string {
|
|||||||
return fmt.Sprintf("%s > %s", s.fullPath(rel.parentPID), rel.name)
|
return fmt.Sprintf("%s > %s", s.fullPath(rel.parentPID), rel.name)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *ItunesScanner) changeDate(t *itl.Track) time.Time {
|
func (s *ItunesScanner) lastChangedDate(t *itl.Track) time.Time {
|
||||||
allDates := []time.Time{t.DateModified, t.PlayDateUTC}
|
allDates := []time.Time{t.DateModified, t.PlayDateUTC}
|
||||||
c := time.Time{}
|
c := time.Time{}
|
||||||
for _, d := range allDates {
|
for _, d := range allDates {
|
||||||
@ -198,7 +198,7 @@ func (s *ItunesScanner) collectMediaFiles(t *itl.Track) *domain.MediaFile {
|
|||||||
mf.Suffix = strings.TrimPrefix(filepath.Ext(path), ".")
|
mf.Suffix = strings.TrimPrefix(filepath.Ext(path), ".")
|
||||||
|
|
||||||
mf.CreatedAt = t.DateAdded
|
mf.CreatedAt = t.DateAdded
|
||||||
mf.UpdatedAt = s.changeDate(t)
|
mf.UpdatedAt = s.lastChangedDate(t)
|
||||||
|
|
||||||
if mf.UpdatedAt.After(s.lastModifiedSince) {
|
if mf.UpdatedAt.After(s.lastModifiedSince) {
|
||||||
mf.HasCoverArt = hasCoverArt(path)
|
mf.HasCoverArt = hasCoverArt(path)
|
||||||
@ -239,7 +239,7 @@ func (s *ItunesScanner) collectAlbums(t *itl.Track, mf *domain.MediaFile, ar *do
|
|||||||
if al.CreatedAt.IsZero() || t.DateAdded.Before(al.CreatedAt) {
|
if al.CreatedAt.IsZero() || t.DateAdded.Before(al.CreatedAt) {
|
||||||
al.CreatedAt = t.DateAdded
|
al.CreatedAt = t.DateAdded
|
||||||
}
|
}
|
||||||
trackUpdate := s.changeDate(t)
|
trackUpdate := s.lastChangedDate(t)
|
||||||
if al.UpdatedAt.IsZero() || trackUpdate.After(al.UpdatedAt) {
|
if al.UpdatedAt.IsZero() || trackUpdate.After(al.UpdatedAt) {
|
||||||
al.UpdatedAt = trackUpdate
|
al.UpdatedAt = trackUpdate
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user