You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							31 lines
						
					
					
						
							599 B
						
					
					
				
			
		
		
	
	
							31 lines
						
					
					
						
							599 B
						
					
					
				package core | 
						|
 | 
						|
import ( | 
						|
	"github.com/gabek/owncast/config" | 
						|
	"github.com/gabek/owncast/core/playlist" | 
						|
	"github.com/gabek/owncast/core/storageproviders" | 
						|
) | 
						|
 | 
						|
var ( | 
						|
	usingExternalStorage = false | 
						|
) | 
						|
 | 
						|
func setupStorage() error { | 
						|
	if config.Config.IPFS.Enabled { | 
						|
		_storage = &storageproviders.IPFSStorage{} | 
						|
		usingExternalStorage = true | 
						|
	} else if config.Config.S3.Enabled { | 
						|
		_storage = &storageproviders.S3Storage{} | 
						|
		usingExternalStorage = true | 
						|
	} | 
						|
 | 
						|
	if usingExternalStorage { | 
						|
		if err := _storage.Setup(); err != nil { | 
						|
			return err | 
						|
		} | 
						|
 | 
						|
		go playlist.StartVideoContentMonitor(_storage) | 
						|
	} | 
						|
 | 
						|
	return nil | 
						|
}
 | 
						|
 |