alvra / django-spotnet

A Django app to manage and download posts from Spotnet.
GNU General Public License v3.0
7 stars 6 forks source link

Show image in Spot #2

Closed hagst closed 11 years ago

hagst commented 11 years ago

Is this possible? I am using Blue-django-spotnet-2f992c6dee29 from 2012-08-23 with the example_project, XP sp3, sqlite3, Django 1.4.2 and Python 2.7.3. The spots are listed and can be opened.

alvra commented 11 years ago

The default template "spotnet/viewpost.html" should contain the image if it's available. Is it missing for all posts or posts that have an image using other spotnet clients?

hagst commented 11 years ago

There are two ways of adding an image when adding a spot.

1- Input a link to the image. This is currently working in Django-spotnet. Spot with image (http link): message-ID: IxU96MSJskfxnH9FYLQuO@spot.net Date: 16 Nov 2012 16:01:37 GMT Image: <Image>http://www.xx/xx/xx.jpg</Image> Used by older spotclients and newer clients who didn't changed this specific option.

2- uploading the image to usenet. This is currently not working in Django-spotnet. Spot without image (segment): message-ID: y0SMyNT3XF4pfO3UAADBz@spot.net Date: 29 Nov 2012 23:47:18 GMT Image: <Image Width='600' Height='425'><Segment>q2k2s2CVPhkAfS3UAAMB4@spot.net</Segment></Image> Used by newer spotclients.

alvra commented 11 years ago

I wasn't aware of that second method, it should definitely be included!

alvra commented 11 years ago

This second method is now supported with the latest commit (bitbucket 89f8802ebb55cc0e1cab0931ffb5fc5701e08e56). It does require renaming the spotnet_post.image column to image_url and adding a image_segments column (see manage.py sqlall spotnet), and re-updating your database to get the correct image for already stored posts.

alvra commented 11 years ago

Btw, you can now overwrite existing posts when updating using the --overwrite / -w flag.

hagst commented 11 years ago

Thanks for adding and the information about changing the database. Thought that manage.py syncdb would update the settings of the database. I have used manage.py sqlall spotnet to list the database layout and manual changed the mysql database.

Spots with image retrieved from usenet are working. The -w switch works.