Skip to content

Commit 9e279d7

Browse files
bakerboy448claude
andcommitted
Update documentation and fix --force-wiki functionality
- Update README.md with latest improvements and multi-subreddit support - Update CLAUDE.md with v2.1 improvements summary - Fix --force-wiki to rebuild from database without API calls - Ensure --force-wiki always recreates wiki using existing data 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent dde11cf commit 9e279d7

3 files changed

Lines changed: 52 additions & 29 deletions

File tree

CLAUDE.md

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -109,27 +109,38 @@ Use `--test` flag to verify configuration and Reddit API connectivity without ma
109109

110110
User profile links are a privacy concern and not useful for modlog purposes.
111111

112-
## Recent Improvements (v2.0)
112+
## Recent Improvements (v2.1)
113113

114-
**Content Linking Fixes**:
115-
- ✅ Content links now point to actual Reddit posts/comments, never user profiles
116-
- ✅ Proper content titles extracted from Reddit API data
117-
- ✅ Short content IDs (e.g., "1mkz4jm") for easy action tracking
118-
119-
**Removal Reason Handling**:
120-
- ✅ Prioritizes actual removal reason text over numbers
121-
- ✅ For `addremovalreason` actions, shows mod_note text instead of numeric details
122-
- ✅ Intelligent handling of text vs numeric removal reasons
114+
**Multi-Subreddit Database Support**:
115+
- ✅ Fixed critical error that prevented multi-subreddit databases from working
116+
- ✅ Single database now safely handles multiple subreddits with proper data separation
117+
- ✅ Per-subreddit wiki updates without cross-contamination
118+
- ✅ Subreddit-specific logging and error handling
123119

124-
**Moderator Display**:
120+
**Removal Reason Transparency**:
121+
- ✅ Fixed "Removal reason applied" showing instead of actual text
122+
- ✅ Full transparency - shows ALL available removal reason data including template numbers
123+
- ✅ Consistent handling between storage and display logic using correct Reddit API fields
124+
- ✅ Displays actual removal reasons like "Invites - No asking", "This comment has been filtered due to crowd control"
125+
126+
**Unique Content ID Tracking**:
127+
- ✅ Fixed duplicate IDs in markdown tables where all comments showed same post ID
128+
- ✅ Comments now show unique comment IDs (e.g., "n7ravg2") for precise tracking
129+
- ✅ Posts show post IDs for clear content identification
130+
- ✅ Each modlog entry has a unique identifier for easy reference
131+
132+
**Content Linking and Display**:
133+
- ✅ Content links point to actual Reddit posts/comments, never user profiles for privacy
134+
- ✅ Fixed target authors showing as [deleted] - now displays actual usernames
135+
- ✅ Proper content titles extracted from Reddit API data
125136
- ✅ AutoModerator displays as "AutoModerator" (not anonymized)
126137
- ✅ Configurable anonymization for human moderators
127-
- ✅ Proper handling of Reddit admin actions
128138

129-
**Multi-Subreddit Support**:
130-
- ✅ Single database supports multiple subreddits with proper data separation
131-
- ✅ Per-subreddit wiki updates without cross-contamination
132-
- ✅ Subreddit-specific logging and error handling
139+
**Data Integrity**:
140+
- ✅ Pipe character escaping for markdown table compatibility
141+
- ✅ Robust error handling for mixed subreddit scenarios
142+
- ✅ Database schema at version 5 with all required columns
143+
- ✅ Consistent Reddit API field usage (action.details vs action.description)
133144

134145
## Common Issues
135146

README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,19 @@ Automatically publishes Reddit moderation logs to a subreddit wiki page with mod
44

55
## Features
66

7-
* 📊 Publishes modlogs as organized markdown tables with content tracking IDs
7+
* 📊 Publishes modlogs as organized markdown tables with unique content tracking IDs
88
* 📧 Pre-populated modmail links for removal inquiries (formatted as clickable markdown links)
9-
* 🗄️ SQLite database for deduplication and retention with multi-subreddit support
10-
* ⏰ Configurable update intervals
11-
* 🔒 Automatic cleanup of old entries
12-
* ⚡ Handles Reddit's 524KB wiki size limit
9+
* 🗄️ SQLite database for deduplication and retention with **multi-subreddit support**
10+
* ⏰ Configurable update intervals with continuous daemon mode
11+
* 🔒 Automatic cleanup of old entries with configurable retention
12+
* ⚡ Handles Reddit's 524KB wiki size limit automatically
1313
* 🧩 Fully CLI-configurable (no need to edit `config.json`)
14-
* 📁 Per-subreddit log files for debugging
14+
* 📁 Per-subreddit log files for debugging and monitoring
1515
* 🔒 Configurable moderator anonymization (AutoModerator/HumanModerator)
16-
* 📝 Stores removal reasons from Reddit API with intelligent text/number handling
17-
* 🔗 Links directly to actual content (posts/comments), never user profiles
18-
* 🆔 Short content IDs extracted from permalinks for easy action tracking
16+
* 📝 **Full removal reason transparency** - shows actual text, template numbers, all available data
17+
* 🔗 Links directly to actual content (posts/comments), never user profiles for privacy
18+
* 🆔 **Unique content IDs** - comments show comment IDs, posts show post IDs for precise tracking
19+
***Multi-subreddit database support** - single database handles multiple subreddits safely
1920

2021
## Quick Start
2122

modlog_wiki_publisher.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1263,13 +1263,24 @@ def main():
12631263
logger.warning("No removal actions found in database for wiki refresh")
12641264
return
12651265

1266-
# Process modlog actions
1266+
# Handle force-wiki: rebuild from database without hitting modlog API
1267+
if args.force_wiki and not args.force_modlog:
1268+
logger.info("Force wiki requested - rebuilding from database without API calls")
1269+
actions = get_recent_actions_from_db(config, force_all_actions=False)
1270+
if actions:
1271+
logger.info(f"Found {len(actions)} actions in database for wiki rebuild")
1272+
content = build_wiki_content(actions, config)
1273+
wiki_page = config.get('wiki_page', 'modlog')
1274+
update_wiki_page(reddit, config['source_subreddit'], wiki_page, content, force=True)
1275+
else:
1276+
logger.warning("No actions found in database for wiki rebuild")
1277+
return
1278+
1279+
# Process modlog actions (normal operation)
12671280
actions = process_modlog_actions(reddit, config)
12681281

1269-
if actions or args.force_wiki:
1282+
if actions:
12701283
logger.info(f"Found {len(actions)} new actions to process")
1271-
if args.force_wiki:
1272-
logger.info("Force Wiki Selected")
12731284
content = build_wiki_content(actions, config)
12741285
wiki_page = config.get('wiki_page', 'modlog')
12751286
update_wiki_page(reddit, config['source_subreddit'], wiki_page, content, force=args.force_wiki)

0 commit comments

Comments
 (0)