9 votes

Why is it that sometimes we see the domain name of the link, sometimes we don't?

8 comments

  1. [3]
    Flashynuff
    Link
    There's some special logic to determine what to show there. Some groups (such as ~music) have a flag that says the user should always be treated as the source. If that flag isn't set, then it's...

    There's some special logic to determine what to show there. Some groups (such as ~music) have a flag that says the user should always be treated as the source. If that flag isn't set, then it's based on if the topic is a text topic.

    Here's the source code if anyone is interested:

    First, the relevant part of the topic template macro:

       {% if topic.is_user_treated_as_source %}
            {% if topic.was_posted_by_scheduler and topic.user_id == -1 %}
              <div class="topic-info-source topic-info-source-scheduled">
                Scheduled topic
              </div>
            {% else %}
              <div class="topic-info-source">
                {{ link_to_user(topic.user) }}
              </div>
            {% endif %}
          {% else %}
            <div class="topic-info-source" title="{{ topic.link_domain }}">
            {% if topic.is_link_type %}
              <div class="topic-icon topic-icon-{{ topic.link_domain.replace('.', '_') }}"></div>
            {% endif %}
            {{ topic.link_source }}
            </div>
          {% endif %}
    

    There's a flag on the topic that says whether the user should be treated as source. If there is, it shows the user, otherwise, it shows the link domain.

    So then what determines that flag? Check out the topic.py model:

        @property
        def is_user_treated_as_source(self) -> bool:
            """Return whether the user that posted the topic is its "source"."""
            if self.group.is_user_treated_as_topic_source:
                return True
    
            return self.is_text_type
    
    7 votes
    1. [2]
      ImmobileVoyager
      Link Parent
      Now, we know everything on how it works. We still don't have a clue as to why or what for.

      Now, we know everything on how it works. We still don't have a clue as to why or what for.

      3 votes
      1. cfabbro
        (edited )
        Link Parent
        Despite all the code behind it, it's actually not that complicated. Pretty much every time a username is shown instead of a domain it's due to it being a text topic or scheduled topic, which are...

        Despite all the code behind it, it's actually not that complicated. Pretty much every time a username is shown instead of a domain it's due to it being a text topic or scheduled topic, which are internally hosted content so there is no external domain to display. And for link topics, it's almost always the domain that is shown.

        The only exceptions to those conditions (AFAIK) is in ~music and ~creative (the mostly "taste-based" and "user created content" groups), where the user who submitted the topic is always listed instead of the domain, since in those groups the submitter is often more valuable to know than the domain.

        E.g. With ~music submissions, the band name is typically included in the topic title, and knowing that the host of the song/album is Youtube, Bandcamp, etc. is largely irrelevant... but knowing who submitted it can often help you decide whether it's worth listening to or not. And there is similar reasoning behind the same behavior in ~creative; Knowing who created/submitted the topic is usually more valuable than knowing the domain of whichever site is hosting the content.

        The logic in ~music and ~creative could probably use some refinement to account for the times when something is being submitted that isn't a song or user-created project, but those are pretty rare occasions so it's not that big of a deal, IMO.

        p.s. Sorry for the delayed response, I somehow missed this when it was first submitted.

        4 votes
  2. [5]
    ImmobileVoyager
    Link
    In the aforelinked image, we see a selection of (seemingly) random contributions, of three or four different kinds. Some are hyperlinks, some are plain text, one is its own kind (Ask (Survey)) and...

    In the aforelinked image, we see a selection of (seemingly) random contributions, of three or four different kinds. Some are hyperlinks, some are plain text, one is its own kind (Ask (Survey)) and then there is Toto Cutugno - Serenata (1984), which links to youtube.com. In the list view, we see OP's username, whereas if this line were like the other we'd expect to see the domain name, unless there is some sort of convoluted consistency that hasn't yet made it way to my undercafeinated neurons.

    2 votes
    1. [4]
      mycketforvirrad
      Link Parent
      Some small updates over the past week – Posted March 9, 2019 by Deimos

      For about the last month, we've been showing domain names for link topics and usernames for text topics in the listings, but some people (rightfully) pointed out that this isn't very good for groups like ~creative where it's important to be able to see who's posting a link. I've updated it now so that I can change this behavior on a per-group basis, and for now, both ~creative and ~music will always show the submitter's name, even on link topics.

      Some small updates over the past week – Posted March 9, 2019 by Deimos

      10 votes
      1. [3]
        ImmobileVoyager
        Link Parent
        Very well. However, I would be as bold as to say that linking a 1980 video of Toto Cutugno isn't that creative, but maybe that's just me ;-)

        Very well.

        However, I would be as bold as to say that linking a 1980 video of Toto Cutugno isn't that creative, but maybe that's just me ;-)

        2 votes
        1. [2]
          whispersilk
          (edited )
          Link Parent
          The feature was enabled in ~music so that if you notice that someone has tastes similar to yours and they post something you haven't heard you can note that it might be something you'd like. And...

          The feature was enabled in ~music so that if you notice that someone has tastes similar to yours and they post something you haven't heard you can note that it might be something you'd like. And vice versa, if someone with very different tastes to yours posts something you can note that it's less likely to be up your alley.

          [Edited for spelling.]

          6 votes