first push

This commit is contained in:
bkfox
2015-06-11 18:25:24 +02:00
parent 83885addeb
commit 55665a919b
15 changed files with 1598 additions and 0 deletions

View File

View File

View File

View File

@ -0,0 +1,29 @@
import os
from django.core.management.base import BaseCommand, CommandError
import programs.models as models
import programs.settings
class Command(BaseCommand):
help= "Take a look at the programs directory to check on new podcasts"
def handle(self, *args, **options):
programs = models.Program.objects.filter(schedule__isnull = True)
for program in programs:
self.scan(program, program.path + '/public', public = True)
self.scan(program, program.path + '/podcasts', embed = True)
self.scan(program, program.path + '/private')
def scan (self, program, path, public = False, embed = False):
try:
for filename in os.listdir(path):
long_filename = path + '/' + filename
except:
pass