fix: token reload
This commit is contained in:
@@ -213,16 +213,17 @@ func (svc *Service) HasUserBought(ctx context.Context, tenantId, userId, mediaId
|
||||
func (svc *Service) Upsert(ctx context.Context, tenantId int64, item media_store.VideoInfo) error {
|
||||
log := svc.log.WithField("method", "Upsert")
|
||||
|
||||
tenantIdStr := fmt.Sprintf("%d", tenantId)
|
||||
resources := pg.MediaResources{}
|
||||
if path.DirExists(filepath.Join(svc.storageConfig.Path, item.Hash, pg.MediaTypeVideo.String())) {
|
||||
if path.DirExists(filepath.Join(svc.storageConfig.Path, tenantIdStr, item.Hash, pg.MediaTypeVideo.String())) {
|
||||
resources = append(resources, pg.MediaTypeVideo)
|
||||
}
|
||||
|
||||
if path.DirExists(filepath.Join(svc.storageConfig.Path, item.Hash, pg.MediaTypeAudio.String())) {
|
||||
if path.DirExists(filepath.Join(svc.storageConfig.Path, tenantIdStr, item.Hash, pg.MediaTypeAudio.String())) {
|
||||
resources = append(resources, pg.MediaTypeAudio)
|
||||
}
|
||||
|
||||
if path.DirExists(filepath.Join(svc.storageConfig.Path, item.Hash, pg.MediaTypePdf.String())) {
|
||||
if path.DirExists(filepath.Join(svc.storageConfig.Path, tenantIdStr, item.Hash, pg.MediaTypePdf.String())) {
|
||||
resources = append(resources, pg.MediaTypePdf)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user