diff --git a/SUMMARY.md b/SUMMARY.md index 0f48648..4260d06 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -376,6 +376,43 @@ Curl scan → Check database → Find 8:30am webhook entry → NFO shows 8:30am --- +--- + +### 🆕 v0.7.1 NFO Organization Improvement (September 2025) + +**📝 Better NFO File Organization:** +- **Problem**: NFOGuard elements mixed throughout existing Radarr metadata made files hard to read +- **Solution**: Move all NFOGuard elements (``, ``, comments) to bottom of NFO files +- **Benefit**: Easier to read NFO files with clean separation between media metadata and NFOGuard management + +**🔧 Technical Implementation:** +- **Smart Element Management**: Remove existing NFOGuard elements and re-add at bottom +- **Preserved Functionality**: All existing behavior maintained, just better organization +- **Both Media Types**: Applied to both movie and TV episode NFO files + +**📋 Before/After NFO Structure:** +```xml + +Movie plot... +2025-09-14T10:02:00-04:00 +Movie Title +true +Director Name + + + +Movie plot... +Movie Title +Director Name + +2025-09-14T10:02:00-04:00 +true + + +``` + +--- + **Last Updated:** September 14, 2025 -**Version:** v0.7.0 +**Version:** v0.7.1 **Status:** Production Ready - Major Architecture \ No newline at end of file diff --git a/VERSION b/VERSION index faef31a..39e898a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.7.0 +0.7.1 diff --git a/core/nfo_manager.py b/core/nfo_manager.py index 21f68be..3d17950 100644 --- a/core/nfo_manager.py +++ b/core/nfo_manager.py @@ -182,18 +182,30 @@ class NFOManager: self._ensure_child_text(root, "premiered", release_date, overwrite=False) self._ensure_child_text(root, "year", release_date.split("-")[0], overwrite=False) + # Add NFOGuard elements at the bottom for better organization + self._strip_existing_footer_comments(root) + + # Remove existing NFOGuard elements to re-add them at bottom + for elem in root.findall(".//dateadded"): + root.remove(elem) + for elem in root.findall(".//lockdata"): + root.remove(elem) + + # Add NFOGuard elements at bottom if dateadded: if dateadded == "MANUAL_REVIEW_NEEDED": - self._ensure_child_text(root, "dateadded", "MANUAL_REVIEW_NEEDED", overwrite=True) + dateadded_elem = ET.SubElement(root, "dateadded") + dateadded_elem.text = "MANUAL_REVIEW_NEEDED" _log("WARNING", f"Set MANUAL_REVIEW_NEEDED marker in NFO: {movie_dir}/movie.nfo") else: - self._ensure_child_text(root, "dateadded", dateadded, overwrite=True) + dateadded_elem = ET.SubElement(root, "dateadded") + dateadded_elem.text = dateadded if lock_metadata: - self._ensure_child_text(root, "lockdata", "true", overwrite=True) + lockdata_elem = ET.SubElement(root, "lockdata") + lockdata_elem.text = "true" # Add footer comments with timestamp - self._strip_existing_footer_comments(root) local_tz = _get_local_timezone() current_time = datetime.now(local_tz).isoformat(timespec="seconds") root.append(ET.Comment(f" source: Movie; {source_detail} "))