from app import create_app, db
from app.models.learning import LearningMaterial

def check_lm_videos():
    app = create_app('development')
    with app.app_context():
        results = db.session.query(
            LearningMaterial.subject, 
            db.func.count(LearningMaterial.id)
        ).filter(LearningMaterial.material_type == 'video_link').group_by(LearningMaterial.subject).all()
        
        for subject, count in results:
            print(f"{subject}: {count} videos")

if __name__ == '__main__':
    check_lm_videos()
