Phoenixak99 commited on
Commit
ed06c16
Β·
verified Β·
1 Parent(s): 492aef1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -17
app.py CHANGED
@@ -909,7 +909,7 @@ def show_sidebar():
909
  # Video "How It Works" - only on video tab
910
  st.markdown("---")
911
  st.markdown("#### ℹ️ How Video Credits Work")
912
- st.markdown("- 🎬 2 free preset video generations")
913
  st.markdown("- πŸ’³ Buy credits for custom videos & more generations")
914
  st.markdown("- 🎞️ **Each credit is tied to the FPS tier you purchased**")
915
  st.markdown("- πŸ”’ To use 24fps, buy credits with 24fps addon")
@@ -928,7 +928,7 @@ def show_sidebar():
928
  col1, col2 = st.columns(2)
929
 
930
  st.markdown("#### πŸ’Ž Audio Credit Packages")
931
- st.info("🎁 **Start FREE!** Get 2 free 30-second samples")
932
 
933
  st.markdown("**Available Packages:**")
934
  st.markdown("- 🎡 **Music with Lyrics**: $7.50 (up to 3 min)")
@@ -944,7 +944,7 @@ def show_sidebar():
944
  # Audio "How It Works" - only on audio tabs
945
  st.markdown("---")
946
  st.markdown("#### ℹ️ How Audio Credits Work")
947
- st.markdown("- 🎁 **2 free 30-second samples** for every user")
948
  st.markdown("- πŸ’³ **Credits charged per generation**")
949
  st.markdown("- ⏱️ **1 credit = any duration** up to 3 minutes")
950
  st.markdown("- 🎡 **With or without lyrics** - same credit cost")
@@ -1778,15 +1778,23 @@ def display_audio_with_controls(audio_bytes, subscription_status, location="main
1778
  ):
1779
  st.success("βœ… Download started!", icon="βœ…")
1780
  else:
1781
- # Downloads available after generation
1782
- if st.download_button(
1783
- label="⬇️ Download Audio",
1784
- data=audio_bytes,
1785
- file_name=f"songlab_track_{location}.wav",
1786
- mime="audio/wav",
1787
- key=f"download_btn_{location}"
1788
- ):
1789
- st.success("βœ… Download started!", icon="βœ…")
 
 
 
 
 
 
 
 
1790
 
1791
  with col2:
1792
  # User dashboard saving removed - only admin auto-save is active
@@ -4069,12 +4077,10 @@ with generation_tab3:
4069
  # Check 3: Preset mode warning for free users
4070
  if not is_custom_mode and video_credits:
4071
  free_remaining = video_credits.get('free_generations_remaining', 0)
4072
- if free_remaining == 2:
4073
- st.info(f"🎁 Using free preset generation (1/2)")
4074
- elif free_remaining == 1:
4075
- st.warning(f"⚠️ Using your LAST free preset generation (2/2) - Purchase credits to continue after this!")
4076
  elif free_remaining == 0:
4077
- st.error(f"πŸ”’ You've used all 2 free generations - Purchase credits to continue")
4078
 
4079
  # Generation Button - Label changes based on mode and eligibility
4080
  if generation_mode == "🎡 Jingle + Video":
 
909
  # Video "How It Works" - only on video tab
910
  st.markdown("---")
911
  st.markdown("#### ℹ️ How Video Credits Work")
912
+ st.markdown("- 🎬 1 free preset video generation")
913
  st.markdown("- πŸ’³ Buy credits for custom videos & more generations")
914
  st.markdown("- 🎞️ **Each credit is tied to the FPS tier you purchased**")
915
  st.markdown("- πŸ”’ To use 24fps, buy credits with 24fps addon")
 
928
  col1, col2 = st.columns(2)
929
 
930
  st.markdown("#### πŸ’Ž Audio Credit Packages")
931
+ st.info("🎁 **Start FREE!** Get 1 free sample on [Generate for Free](https://songlabai.com/generate-music-free/) page")
932
 
933
  st.markdown("**Available Packages:**")
934
  st.markdown("- 🎡 **Music with Lyrics**: $7.50 (up to 3 min)")
 
944
  # Audio "How It Works" - only on audio tabs
945
  st.markdown("---")
946
  st.markdown("#### ℹ️ How Audio Credits Work")
947
+ st.markdown("- 🎁 **1 free sample** (available on [Generate for Free](https://songlabai.com/generate-music-free/) page)")
948
  st.markdown("- πŸ’³ **Credits charged per generation**")
949
  st.markdown("- ⏱️ **1 credit = any duration** up to 3 minutes")
950
  st.markdown("- 🎡 **With or without lyrics** - same credit cost")
 
1778
  ):
1779
  st.success("βœ… Download started!", icon="βœ…")
1780
  else:
1781
+ # Downloads available for credit purchasers only (Streamlit is paid-only)
1782
+ remaining_credits = subscription_status.get('remaining_credits', 0)
1783
+
1784
+ if remaining_credits > 0 or subscription_status.get('total_credits', 0) > 0:
1785
+ # User has purchased credits - allow download
1786
+ if st.download_button(
1787
+ label="⬇️ Download Audio",
1788
+ data=audio_bytes,
1789
+ file_name=f"songlab_track_{location}.wav",
1790
+ mime="audio/wav",
1791
+ key=f"download_btn_{location}"
1792
+ ):
1793
+ st.success("βœ… Download started!", icon="βœ…")
1794
+ else:
1795
+ # No credits purchased - block download
1796
+ st.button("πŸ”’ Download (Purchase Credits Required)", disabled=True, key=f"download_btn_{location}")
1797
+ st.info("πŸ’‘ Download is included with credit purchases. Visit [Pricing Page](https://songlabai.com/credit-pricing/) to buy credits.")
1798
 
1799
  with col2:
1800
  # User dashboard saving removed - only admin auto-save is active
 
4077
  # Check 3: Preset mode warning for free users
4078
  if not is_custom_mode and video_credits:
4079
  free_remaining = video_credits.get('free_generations_remaining', 0)
4080
+ if free_remaining == 1:
4081
+ st.info(f"🎁 Using your 1 free preset generation - Purchase credits to continue after this!")
 
 
4082
  elif free_remaining == 0:
4083
+ st.error(f"πŸ”’ You've used your 1 free generation - Purchase credits to continue")
4084
 
4085
  # Generation Button - Label changes based on mode and eligibility
4086
  if generation_mode == "🎡 Jingle + Video":