openfree commited on
Commit
657a5b6
·
verified ·
1 Parent(s): 295a976

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -1945,14 +1945,17 @@ def download_novel(novel_text: str, format: str, language: str, session_id: str
1945
  stages = NovelDatabase.get_stages(session_id)
1946
  logger.info(f"Found {len(stages)} stages in database")
1947
 
1948
- # 테스트 모드 감지 - Writer 2까지만 있고 전체 stage가 9개면 테스트 모드
1949
  is_test_mode = False
1950
- has_writer2 = any(stage['role'] == 'writer2' for stage in stages)
 
1951
  has_writer3 = any(stage['role'] == 'writer3' for stage in stages)
1952
- if has_writer2 and not has_writer3 and len(stages) <= 10:
 
1953
  is_test_mode = True
1954
- logger.info("Test mode detected - will export 2 chapters only")
1955
 
 
1956
  timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
1957
 
1958
  if format == "DOCX" and DOCX_AVAILABLE:
 
1945
  stages = NovelDatabase.get_stages(session_id)
1946
  logger.info(f"Found {len(stages)} stages in database")
1947
 
1948
+ # 테스트 모드 감지 - writer10이 있으면 테스트 모드
1949
  is_test_mode = False
1950
+ has_writer10 = any(stage['role'] == 'writer10' for stage in stages)
1951
+ has_writer1 = any(stage['role'] == 'writer1' for stage in stages)
1952
  has_writer3 = any(stage['role'] == 'writer3' for stage in stages)
1953
+
1954
+ if has_writer10 and has_writer1 and not has_writer3:
1955
  is_test_mode = True
1956
+ logger.info("Test mode detected - writer1 + writer10 mode")
1957
 
1958
+
1959
  timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
1960
 
1961
  if format == "DOCX" and DOCX_AVAILABLE: