Skip to content

Commit

Permalink
Update front.py
Browse files Browse the repository at this point in the history
  • Loading branch information
poojaharihar03 authored Jun 20, 2024
1 parent 6ce457e commit 1df893e
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions emotion-based music recommendtion/front.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,8 @@
else:
query = map_emotion_to_query(emotion)
st.write(f'Search Query: {query}')
order = {
'Relevance': 'relevance',
'View count': 'viewCount',
'Rating': 'rating',
'Date': 'date'
}[sort_order]
recommendations = get_youtube_recommendations(query, language, order)

recommendations = get_youtube_recommendations(query, language)
st.session_state['recommendations'] = recommendations
st.session_state['video_urls'] = [item.split('(')[-1].split(')')[0] for item in recommendations if '(' in item]

Expand All @@ -76,4 +71,4 @@

if st.session_state['selected_video']:
st.write(f"Playing video: {st.session_state['selected_video']}")
st.video(st.session_state['selected_video'])
st.video(st.session_state['selected_video'])

0 comments on commit 1df893e

Please sign in to comment.