fix(scanner): check user ID instead of IsAdmin for playlist import guard

The condition `!u.IsAdmin && u.ID == ""` was wrong — with the synthetic
admin fallback (IsAdmin: true, ID: ""), it evaluated to false and
allowed playlist import with an empty OwnerID. The check should be
just `u.ID == ""` to skip whenever there's no real user.
This commit is contained in:
Deluan 2026-05-04 17:58:26 -04:00
parent 5b01636d33
commit fec03d8780

View File

@ -50,7 +50,7 @@ func (p *phasePlaylists) produce(put func(entry *model.Folder)) error {
return nil
}
u, _ := request.UserFrom(p.ctx)
if !u.IsAdmin && u.ID == "" {
if u.ID == "" {
log.Warn(p.ctx, "Playlists will not be imported, as there are no admin users yet, "+
"Please create an admin user first, and then update the playlists for them to be imported")
return nil