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

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

if __name__ == '__main__':
    check_lang_videos()
